Reza
Reza

Reputation: 543

File upload using ng-file-upload in spring mvc

I used ng-file-upload for uploading a file, but in my spring mvc controller with @RequestPart MultipartFile, the getOriginalFilename() method returns blob not the file name

@RequestPart(value = "imageFile", required = false) MultipartFile imageFile

The console log for my upload is:

{$ngfName: "UI-UX.jpeg", $ngfOrigSize: 133046, size: 6320, type: "image/jpeg"}

My file uploads correctly but I don't know why the file name is not correct.

Can you please help me?

Thanks.

Upvotes: 0

Views: 287

Answers (1)

Hai Pandu
Hai Pandu

Reputation: 57

Try with this

@RequestParam("image") MultipartFile image

Upvotes: 1

Related Questions