Upload base64

43 views
Skip to first unread message

IHateSoda

unread,
Mar 16, 2012, 5:25:32 PM3/16/12
to Google Web Toolkit
Hello,

I'm using HTML5 Drag and Drop in my application, the DND works but I
can't upload the image to the server, the format is base64 (data:image/
jpeg;base64,/9j/4AAQSkZJRgAB........). I need to upload this image and
after create this image in my WAR Directory.

I need some help plz

Steve Moyer

unread,
Mar 26, 2012, 7:28:42 PM3/26/12
to Google Web Toolkit
What on the server is accepting the image you want to send it? I
think it's dangerous to be writing into your war folder so you should
have a work directory somewhere else. And if the servlet can write
the image there, you can also let the servlet read the image when you
want to access it.

smoyer

Joseph Lust

unread,
Mar 27, 2012, 9:26:34 PM3/27/12
to google-we...@googlegroups.com
SodaH8r,

Can you store this image as a clob or blob in your database? Depending on the size of your application, you'll see performance degradation once you get over 10-20K items in a single directory. Storing them in a database will also mean you are not tied to a single machine as your application grows.

Finally, uploading user files to a server directory is one of the most common attack vectors. If you do so, make sure they are not given executable permissions and validate that they are truly images before saving them to disk.

Sincerely,
Joseph
Reply all
Reply to author
Forward
0 new messages