I want to let users upload photos to Facebook in my image viewer app. As seen in this post, Facebook Graph API - upload photo using JavaScript, I have to encode my photos as multipart/form-data to be able to upload them. How to archive this encoding on Windows.Storage.StorageFile
items?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You need to open that photo (of type
Windows.Storage.StorageFile
) for reading, convert it's stream to blob, append it toFormData
object and upload using whatever Ajax library you want (WinJS.xhr
,jQuery.ajax
etc).Following code illustrates it better than words: