0

I receive a request (multipart/form-data POST), parameter "file" contains file as a base64 (example below)

------WebKitFormBoundaryEA37wQGzpnprPt8x\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\nJVBERi0xLjQNJeLjz9MNCjEgMCBvYmoNPDwvQXV0aG9yIChNYXJrbyBLZWpcMjM2YXIpL0Ny\r\nZWF0aW9uRGF0ZSAoRDoyMDE2MTEyMjExMzc0NCswMScwMCcpL0NyZWF0b3IgKE1TIFdvcmQg\r\nRG9jdW1lbnQ

I am curious how to decode it (using JAVA of course) from there and get a file.

  1. Should I somehow delete system information (WebKitFormBoundary and Content-Disposition)?
  2. I also noticed that content full of \r\n Do I need to delete it myself as well?
Dmytro Pastovenskyi
  • 5,240
  • 5
  • 37
  • 56
  • What server technology are you using? Servlet? --- Also, that looks like the content of a `multipart/form-data` POST. If you look at the HTTP header `Content-Type`, you'll see that type. You should search the web for more information about how `multipart/form-data` works. – Andreas Nov 27 '16 at 16:37
  • @Andreas it is Servlet and es, it is multipart/form-data. OK, I will read of course more, but a code-tip would be great ;) – Dmytro Pastovenskyi Nov 27 '16 at 16:56

1 Answers1

-1

you can use following link to decode from base64

Thili
  • 748
  • 1
  • 9
  • 21