Use Google Appengine BlobstoreService and ImageService to upload/serve Paintweb images

152 views
Skip to first unread message

Doug Daniels

unread,
Sep 20, 2010, 11:19:59 PM9/20/10
to PaintWeb discussions
I was wondering if anyone has had experience using Paintweb and Google
appengine. I've got a basic prototype working and submitting base64
encoded images to a Java servlet which are then stored in the
appengine datastore as a binary blob and retrieved and served by
another servlet.

Google appengine 3.6 (http://googleappengine.blogspot.com/2010/08/
multi-tenancy-support-high-performance_17.html) now supports a more
efficient way to upload/serve images, but it requires that the user
uploads a file in a encoding type "multipart/form-data".

http://code.google.com/appengine/docs/java/blobstore/overview.html#Uploading_a_Blob

Has anyone had experience writing an XMLHttpRequest with a custom MIME
type multipart/form-data with the Paintweb image encoded properly?

I have an open question on stackoverflow about this, but I was
thinking the Paintweb community might have a better clue as to how to
make the internals Google Appengine Blobstore compatible.

http://stackoverflow.com/questions/3747433/use-blobstoreservice-and-imageservice-to-upload-serve-images-drawn-from-an-html5

The only thing I've found about creating a AJAX POST as a "multipart/
form-data" is this Firefox example (that requires you to change
browser security settings, but that just seems necessary if you need
file system access).
http://www.captain.at/ajax-file-upload.php

Mihai Sucan

unread,
Sep 24, 2010, 5:28:17 AM9/24/10
to Doug Daniels, PaintWeb discussions
Hello Doug!

Thanks for your interest into PaintWeb!

I haven't used Google App Engine with PaintWeb, but you should be able to
nicely send it a JSON with XMLHttpRequest, containing the image data URI
generated by PaintWeb. Just follow the official docs from Google App
Engine, and you should be fine.

The answer you got from Stackoverflow sounds really good - same thoughts
here.

You may also want to check how you can integrate PaintWeb into your web
apps:

http://code.google.com/p/paintweb/wiki/Integration#Image_save_integration

You need to write a minimal extension for PaintWeb which handles the
imageSave event. When you get the event, you also receive the updated
image data URI that you can then pass to your server-side code, using an
XMLHttpRequest.

If you want to see a working example, take a look at the Moodle
integration code:

http://code.google.com/p/paintweb/wiki/MoodleIntegration

Here is the PaintWeb extension which handles the imageSave event inside
PaintWeb:

http://code.google.com/p/paintweb/source/browse/trunk/src/extensions/moodle.js#134

As you can see, it constructs an XMLHttpRequest which is sent to the
server-side script.

Obviously, the server-side script needs to take the data URI and save it
somewhere on the server, and send back the URL to the saved image.

I hope the above answers your question. Please let me know if you have
further questions, I am glad to help!


Best regards,
Mihai


Le Tue, 21 Sep 2010 06:19:59 +0300, Doug Daniels
<daniels...@gmail.com> a écrit:


--
Mihai Sucan
http://www.robodesign.ro

Message has been deleted

MC

unread,
Sep 20, 2012, 12:33:36 PM9/20/12
to pain...@googlegroups.com
Greetings,
Thank you for Paintweb! I've started trying to integrated into a project using classic ASP. The links in this email thread are dead, unfortunately, so I can't see how this was implemented. I want to click the Save icon and have the base64 URL pass back to a database using classic ASP code. Are there any examples of this? I've googled' and can find no examples. Thank you!
Reply all
Reply to author
Forward
0 new messages