I'm exporting a canvas content as String to a servlet, to generate 
downloadable file. But the resulting file is not viewable. What could I be 
missing

Send to servlet:
String content = canvas.toDataUrl("image/png");

Servlet handling:
response.setHeader("Content-Disposition", "attachment; 
filename=\"myfile.png\"")
response.setContentType("image/png");

outputStream.write(..);


I can see the downloaded image starts like this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABi...

Maybe this is a problem? But removing "data:image/png" or "base64" or both, 
it neither can be viewed.



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to