I need to rename a mutipartFile before uploading it.
I used MockMultipartFile
to rename it but an OutOfMemoryError
occurs because it 's a large file and MockMultipartFile
loads multipartFile.getBytes()
.
Is there another solution?
My code is :
multipartFile = new MockMultipartFile(mf.getName(), "nomFichier", mf.getContentType(),mf.getBytes());