You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I support an Angular/Java/Spring webapp.
Recently upgraded angular-file-uploader from 4.2.1 to 5.0.2 to take advantage of "replaceTexts:" feature.
With 4.2.1 all of the files POSTed with multiple file upload shared the same request parameter name i.e. "name=file";
After the upgrade to 5.0.2 each file received a unique request parameter name that appears to have an array index appended e.g.: "name=file0" ..."name=file1" .
This app. uses Spring MVC to access the multiple files uploaded as a "MultipartFile[]" array.
Example API method:
@PostMapping("/addAttachment/{workInfoId}")
public WorkInfoJson addAttachment(@PathVariable("workInfoId") int workInfoId,
@RequestParam("file") MultipartFile[] file {...}
I support an Angular/Java/Spring webapp.
Recently upgraded angular-file-uploader from 4.2.1 to 5.0.2 to take advantage of "replaceTexts:" feature.
With 4.2.1 all of the files POSTed with multiple file upload shared the same request parameter name i.e. "name=file";
After the upgrade to 5.0.2 each file received a unique request parameter name that appears to have an array index appended e.g.: "name=file0" ..."name=file1" .
This app. uses Spring MVC to access the multiple files uploaded as a "MultipartFile[]" array.
Example API method:
Example request from devtools:
Is there a way to control the request parameter name assigned to multiple files so that the Spring MVC method will "see" them as an array of files?
My apologies if this is something simple that I have overlooked.
Thanks!
Versions:
The text was updated successfully, but these errors were encountered: