How Do You Download An Image With Google Drive Api V3 To A Browser Client?
The objective is to let the user of an app download an image (jpg) from Google Drive via a browser. Using the code further down, I do manage to have the browser prompt the 'Save as
Solution 1:
I have experienced the same issue with your situation. At that time, at first, I converted the returned value to Unit8Array and converted it to the blob. So, in your script, how about the following modification?
From:
const objectUrl = URL.createObjectURL(new Blob([response.body] , {type:'image/jpeg'}))
To:
const objectUrl = URL.createObjectURL(new Blob([new Uint8Array(response.body.length).map((_, i) => response.body.charCodeAt(i))], {type: 'image/jpeg'}));
Post a Comment for "How Do You Download An Image With Google Drive Api V3 To A Browser Client?"