Answered by:
How to get a Blob object from FilePicker for XHR POST Request?

Question
-
Hello.
I need to send an image taken from FilePicker via XHR POST Request.
How can I get a [object Blob] from StorageFile class to send it?Saturday, December 24, 2011 6:44 AM
Answers
-
I got Tweet@rama's code to work, so I get [object Blob] as I need, but it wasn't that what I need.
Now I need [object File] and I moved the thread to http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/05921f3a-bee7-4fa3-80ff-85bff1161b4b .
- Marked as answer by Moushen Friday, December 30, 2011 2:44 PM
Friday, December 30, 2011 2:44 PM
All replies
-
Hi Moushen,
The Blog sample scenario 1 gets a Blog from the file picker:
http://code.msdn.microsoft.com/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=1754477665
-Jeff
Jeff Sanders (MSFT)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Tuesday, December 27, 2011 6:29 PM
- Unproposed as answer by Moushen Wednesday, December 28, 2011 1:34 PM
- Marked as answer by Moushen Friday, December 30, 2011 2:44 PM
- Unmarked as answer by Moushen Friday, December 30, 2011 2:44 PM
Tuesday, December 27, 2011 6:29 PMModerator -
Hi Jeff,
The sample outputs not what I want.
I need exactly [object Blob], not- [object Windows.Storage.StorageFile] - file
- blob:273324B50F6F - URL.createObjectURL(file)
Is there any way to transform an image from FilePicker to Blob without using canvases?
Btw Tweet@rama's code didn't work, the Blob I get isn't valid ( image with src = URL.createObjectURL(theBlob) doesn't appear ).
Thanks.
Wednesday, December 28, 2011 1:34 PM -
I got Tweet@rama's code to work, so I get [object Blob] as I need, but it wasn't that what I need.
Now I need [object File] and I moved the thread to http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/05921f3a-bee7-4fa3-80ff-85bff1161b4b .
- Marked as answer by Moushen Friday, December 30, 2011 2:44 PM
Friday, December 30, 2011 2:44 PM