Upload File To Google Drive

Upload image to Google Drive using Google Apps Script aka GAS with base64. Google Apps Script only support a maximum blob size of 50MB. So you can only upload a file of a maximum of 50MB using this method.


function doPost(e){
    var data = Utilities.base64Decode(e.parameters.data);
    var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
    DriveApp.createFile(blob);
    return ContentService.createTextOutput("Done.")
}