Current request is not a multipart request in spring boot backend #967
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, I try upload file to java backend but I have a error: Current request is not a multipart request.
When I use postman the file upload good but from angular frontend not working.
My code is:
`ngOnInit() {
}`
I change disableMultipart: true but the post not working.
if you want to post a multipart request, maybe active multipart ? (disableMultipart: false, or nothing, it's false by default). If you want to add fields to your post request, use additionalParameter option.
can you show 2 post request (1 working, 1 not) ?
With spring boot, it works as is.
@RequestMapping(method = RequestMethod.POST, path = "/{id}/documents") public DeferredResult<ResponseEntity<?>> uploadDocuments( @PathVariable String id, @RequestParam("file") MultipartFile[] files ) {client
upload() { this.uploader.uploadAll(); } ngOnInit() { this.uploader = new FileUploader({ url:${config.API_URL}/v1/quote/${id}/documents}); }