it’s fail if I resize photo file size and upload photo to Google Drive. I have been trying to figure out this question for three months but still have no idea.
Using an image in the assets I have it working here:
I used my ImageBase64 extension to get the base64String from the optimised image displayed in the image component
function doPost(e) {
var data = Utilities.base64Decode(e.parameters.data);
var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
var fileID = DriveApp.getFolderById(e.parameters.folderId).createFile(blob).getId();
return ContentService.createTextOutput(fileID);
}
Looks like you are trying to upload four images at once. This will not work. Do them one at a time in a loop, using the Web1.GotText to start the next upload.
First of all, uploading four photos is totally fine, but when I tried to combine with the compression function, it fail even I only compress and upload one photo, the photo was uploaded without any compression. Maybe it because the composition module still uploads four pictures at once?Do I have to use the loop method to compress and upload multiple photos?
Hello Kumaraswamy,
I am new to MIT app inventor so unable to use your code can you please share video for image optimizer that will helpful for all other new bies like me.