File
获取file类型
ContentType
public interface MultipartFile extends InputStreamSource {
String getName();
@Nullable
String getOriginalFilename();
@Nullable
String getContentType();
boolean isEmpty();
long getSize();
byte[] getBytes() throws IOException;
InputStream getInputStream() throws IOException;
default Resource getResource() {
return new MultipartFileResource(this);
}
void transferTo(File var1) throws IOException, IllegalStateException;
default void transferTo(Path dest) throws IOException, IllegalStateException {
FileCopyUtils.copy(this.getInputStream(), Files.newOutputStream(dest));
}
}
常见ContentType
手机上传视频保存到ftp服务器,file文件流是 .tmp文件 contentType 格式是:application/octet-stream
常用的上传图片,视频,语音的contentType 有:application/octetstream、image/png、image/gif、image/jpeg、image/pjpeg、audio/mpeg、video/mp4
TODO
未完待续