Skip to main content
added 15 characters in body
Source Link
Sagir
  • 19
  • 2
  • 9

Convert you FilePart to File then use file object use as you want Convert filepart to Byte Array

private Filebyte[] convertMultiPartToFileconvertFilePartToByteArray(FilePart file) throws IOException { File convFile = new File(file.filename()); file.transferTo(convFile); return convFile;Files.readAllBytes(convFile.toPath()); } 

Convert you FilePart to File then use file object use as you want

private File convertMultiPartToFile(FilePart file) { File convFile = new File(file.filename()); file.transferTo(convFile); return convFile; } 

Convert filepart to Byte Array

private byte[] convertFilePartToByteArray(FilePart file) throws IOException { File convFile = new File(file.filename()); file.transferTo(convFile); return Files.readAllBytes(convFile.toPath()); } 
Source Link
Sagir
  • 19
  • 2
  • 9

Convert you FilePart to File then use file object use as you want

private File convertMultiPartToFile(FilePart file) { File convFile = new File(file.filename()); file.transferTo(convFile); return convFile; }