Hi everyone,
Here’s my situation: my app can receive images from external apps (through the share menu).
So for example, when a user goes to his Google Photo Library app, he selects an image, clicks share and choose my app. My app receives a URL for the internal image.
Now, I want to get a Blob object from that URL. Here’s the way I’m trying to get it:
getBlob(path: string): Promise<any> {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open('GET', path, true);
xhr.responseType = 'blob';
xhr.onerror = function(e) {
console.info("status: "+e.target["status"])
}
xhr.onload = function(e) {
if (this.response) {
resolve(this.response);
}
};
xhr.send();
})
}
However, the status code is 0.
Here’s an example URL: content://media/external/images/media/48
Any help would be appreciated…