Код: Выделить всё
OutputStream outputStream;
final DiskFileItem diskFileItem = new DiskFileItem("file", mimeType, false, fileName, fileSize, repo));
try (InputStream inputStream = new FileInputStream(actualFile)) {
outputStream = diskFileItem.getOutputStream();
IOUtils.copy(inputStream, outputStream);
return new CommonsMultipartFile(diskFileItem);
} catch (Exception e) {
throw new GoogleConversionFailedException("Cannot build MultipartFile", e);
}
Подробнее здесь: https://stackoverflow.com/questions/756 ... tipartfile
Мобильная версия