提交 a94ea5a7 authored 作者: 任建彩's avatar 任建彩

feat:打包文件名

1.file
上级 f1f47881
......@@ -71,10 +71,16 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, FileInfo> implement
FileOutputStream fos = null;
BufferedOutputStream bos = null;
FileInfo entity = new FileInfo();
int read = 0;
final byte[] bytes = new byte[1024*1024*100];
try {
fos = new FileOutputStream(filePath);
bos = new BufferedOutputStream(fos);
bos.write(file.getBytes());
InputStream inputStream = file.getInputStream();
while((read = inputStream.read(bytes))!=-1) {
bos.write(bytes,0,read);
}
//bos.write(file.getBytes());
entity.setFileName(uuid);
entity.setOriginalFileName(fileName);
entity.setSuffixName(suffixName);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论