Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

file to multipartfile in java

File file = new File("src/test/resources/input.txt");
FileInputStream input = new FileInputStream(file);
MultipartFile multipartFile = new MockMultipartFile("file",
            file.getName(), "text/plain", IOUtils.toByteArray(input));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #file #multipartfile #java
ADD COMMENT
Topic
Name
3+3 =