Real simple task. I have a url to a file in the Win8 client app which I got from doing something like this:
this.image = URL.createObjectURL(file);
and now I need to send the file over the internet kind of like this:
var options = {
type: method,
url: MyApplication.servicesUri + "rest/" + dpName + queryParameters,
headers: { "Content-type": "application/json" },
data: JSON.stringify(objParameters)
};
WinJS.xhr(options)
So the thing is, how do I ‘reverse’ my first operation and get the file so I can set it as the data of my PUT request?
I solved this issue with a different approach, but the answer to this question comes from the DataRead. Take a look at the example on the msdn page.