To move files within shared drives (team drives) at GAS
I try using Drive.Files.update.
I am running with the code below, but there is a 404 error and I am not sure what is wrong.
Is the authentication setting insufficient?
You can also try using APIs Explorer to run it.
function moveFile(){
varfileId="1-U2N35iiwcz_Q8KXXXXXXXXXXXXXX";
varsourceFolderId="1gAF-FfwQ0nXXXXXXXXXX";
vardestFolderId="19wJOjV7XXXXXXXXXXXXXX";
Drive.Files.update({"fileId":fileId, "addParents":destFolderId, "removeParents":sourceFolderId, "supportAllDrives":true},
function(err,file){
if(err){
Logger.log(err+"file:"+file);
// Handle error
} else{
// File moved.
}
});
};
IDI'm masking my ID
google-apps-script google-drive-sdk
"It's too late now, but I received advice to post it as ""self-answer"" when I solved myself, so
"
I will update here.
It seems to have confused the execution of GAS and Javascript.
It seems that the parameters were not set well.
Drive.Files.update(
Null//File resource is fine without
,fileId//FileId
Not specified as it is not a ,null//media file
, {'addParents':destFolderId
, 'removeParents': sourceFolderId
, 'supportAllDrives': true // Deprecated but Unspecified Not Found
} // Specified in Optional query parameters
);
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.