0

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.

1
  • use this @RequestPart("file") MultipartFile file String fileName;fileName = file.getOriginalFilename();
    – Umapathi
    CommentedJun 13, 2017 at 12:49

1 Answer 1

1

Try with this

@RequestParam("image") MultipartFile image 

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.