0

I want send CommonsMultipartFile from ajax call to server when user select the file. File can not be directly send through JSON as it gives the error mentioned here(JsonMappingException: Can not construct instance of CommonsMultipartFile).

Is there any way to encode this (CommonsMultipartFile) in the client side (JSP page) to generate string?

Community
  • 1
  • 1
abo
  • 378
  • 4
  • 19

1 Answers1

0

This post gives the solution Image convert to Base64.

e.target.result; gives 64 base encoded string.

And this post Convert base64 string to image explain how we can decode in the server side.

Community
  • 1
  • 1
abo
  • 378
  • 4
  • 19