当前位置:网站首页>Multipartfil to file
Multipartfil to file
2022-07-26 10:53:00 【Eric-x】
/** * MultipartFile Convert to File file * * @param multipartFile * @return */
public final static File transferToFile(MultipartFile multipartFile) {
// Choose to implement this transformation with a buffer, that is, use java Temporary files created Use MultipartFile.transferto() Method .
File file = null;
try {
String originalFilename = multipartFile.getOriginalFilename();
// Get file suffix
String prefix = originalFilename.substring(originalFilename.lastIndexOf("."));
file = File.createTempFile(originalFilename, prefix); // Create temporary file
multipartFile.transferTo(file);
// Delete
file.deleteOnExit();
} catch (IOException e) {
e.printStackTrace();
}
return file;
}
边栏推荐
- Bash shell learning notes (4)
- 公司项目中的biz层和manager层是干啥的
- 20210807 1 c language program structure
- 2021-08-14 Sanzi chess
- MFC picture control
- 解决:无法加载文件 C:\Users\user\AppData\Roaming\npm\npx.ps1,因为在此系统上禁止运行脚本 。
- RT thread learning notes (I) -- configure RT thread development environment
- 按二进制数中1的个数分类
- 企鹅龙(DRBL)无盘启动+再生龙(clonezilla)网络备份与还原系统
- The assignment of member pointer defined in C structure and the use of structure pointer as member function parameter
猜你喜欢

企鹅龙(DRBL)无盘启动+再生龙(clonezilla)网络备份与还原系统

按二进制数中1的个数分类

Codepoint 58880 not found in font, aborting. flutter build apk时报错

20210807 1 c language program structure

Traversal recursion + iteration of binary tree

35. Search the insertion position

Flutter编译报错 version of NDK matched the requested version 21.0.6113669. Versions available locally: 2

微信公众号消息通知 “errcode“:40164,“errmsg“:“invalid ip

nmap弱点扫描结果可视化转换

0x00007FFD977C04A8 (Qt5Sqld.dll)处(位于 a.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000000000000010 时发生访问冲突
随机推荐
349. 两个数组的交集
Bash shell学习笔记(四)
Implementing queues with two stacks
10 let operator= return a reference to *this
公司项目中的biz层和manager层是干啥的
2021-08-12 function recursion_ Learn C language with brother Peng
RT thread learning notes (VI) -- start the elmfat file system based on SPI flash (Part 1)
SparseArray of the source code for novices
router.push(),router.repalce(),router.go()使用
Visual conversion of nmap vulnerability scanning results
postman 导出导入
@JsonFormat和@DateTimeFormat的区别和使用
Fragment lazy load
Sql Server之查询总结
logging基本使用
微信公众号消息通知 “errcode“:40164,“errmsg“:“invalid ip
LIst和Dictionary实例应用(※)
SQL Server 之Sql语句创建数据库
MySQL quicklearn-2021-09-01
Bash shell learning notes (I)