google-app-makergoogle-drive-picker

Keep getting "Server Rejected" when I try to upload a file to a Google Drive Folder


So my app was working (was able to upload file to a Google Drive folder). But today, it doesn't work all of a sudden. Whenever I want to upload the file, it keeps saying "server rejected" which I'm not sure why.

I use drive picker and onPickerInit, this is what I put as a custom action:

var folderId = "1t6MrDgiWj0tHEEX0QgxhLerDuDIht1gPPP"; //the desired folder id - I put a fake Id
pickerBuilder.SW.Vq["0"].mc.parent = folderId;

Solution

  • I just put this on the server script and it fixes the problem:

    function writeAccess() { DriveApp.addFile(); }