FileSubmitter in Chrome

14 views
Skip to first unread message

Camaron

unread,
Sep 17, 2009, 6:05:48 PM9/17/09
to Gears Users
Hello

I am trying to write a Chrome extension that allows to resize an image
before uploading it.
So far I've used Gears to open and scale the image, now I can't add to
the original <input type="file"/> element, since FileSubmitter is only
implemented in IE and Firefox.

Is there any hope for me to set the file of an <input type="file"/> to
the URL of a captured blob by any other means?

Alexandre Gomes

unread,
Sep 23, 2009, 1:03:11 PM9/23/09
to gears...@googlegroups.com
You can try to use Gears.XMLHttpRequest to upload the blob.

Camaron

unread,
Oct 9, 2009, 11:16:58 AM10/9/09
to Gears Users
I can't use XMLHttpRequest since I need to use the original form,
which could be any form from any website.

kmike

unread,
Oct 12, 2009, 12:40:26 AM10/12/09
to Gears Users
> Is there any hope for me to set the file of an <input type="file"/> to
the URL of a captured blob by any other means?

Yes, you can emulate classic multipart form submissions with Gears.

I've just created GearsUploader project on bitbucket:
http://bitbucket.org/kmike/gearsuploader/overview/
Maybe GearsMultipartForm.js is what you need:

http://bitbucket.org/kmike/gearsuploader/src/tip/GearsUploader/GearsMultipartForm.js

Mika Tuupola

unread,
Oct 13, 2009, 8:03:02 AM10/13/09
to gears...@googlegroups.com

On Oct 12, 2009, at 7:40 AM, kmike wrote:

> Yes, you can emulate classic multipart form submissions with Gears


> http://bitbucket.org/kmike/gearsuploader/src/tip/GearsUploader/GearsMultipartForm.js

Your class is quite elegant. I wrote something similar recently:

http://www.appelsiini.net/2009/10/drag-and-drop-file-upload-with-google-gears

--
Mika Tuupola
http://www.appelsiini.net/

Reply all
Reply to author
Forward
0 new messages