Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created August 7, 2018 09:55
Show Gist options
  • Select an option

  • Save Ikhiloya/76b9989e06ea9d4e46ac4a9d646fae85 to your computer and use it in GitHub Desktop.

Select an option

Save Ikhiloya/76b9989e06ea9d4e46ac4a9d646fae85 to your computer and use it in GitHub Desktop.
A simple code to convert a multi[part file to an inputStream and extract contents from a multipart file
public void extractMultipartFile(MultipartFile file){
InputStream inputStream =file.getInputStream();
String originalFileName = file.getOriginalFilename();
String fileName = file.getName();
byte[] bytes = file.getBytes();
String contentType = file.getContentType();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment