1
votes

Is it possible to move file from appDataFolder to user's root folder on Google Drive using drive API v2 or v3? I can't find any example how to do that. I just try to use gapi.client.drive.files.update from javascript drive v3 API and addParents parameter to change folder, it works fine with files in user's root folder, but doesn't work with files in appDataFolder.

I know that it is possible to copy file from appDataFolder to user's drive root, but I need to keep fileId, and copying generates new fileId for copied file.

I found there is a file property called "spaces" and files from appDataFolder a in spaces=appDataFolder whereas files from user's root folder are in spaces=drive. Is it possible to move file between these spaces keeping same fileId?

I found some similar posts:
Copy an exising Drive file into the appdata folder
Is it possible to share the application data on google drive
and it looks like it is not possible to do it this way. When I check my console I also get "Method not supported for appdata contents" or "Method not supported for files within the Application Data folder." message.

So is there any method to move file from appDataFolder?

Thank's for help.

1
If by root folder, you mean the top-most folder, have you tried doing the reverse when moving files from root to appDataFolder with addParents by using removeParents query parameters on your files.update method as discussed in Moving files between folders?Teyam
Thank's for reply. Yes, by root I mean top most folder. I write my file to appDataFolder by Android drive API in my Android application and want to move this file to root folder by javascript drive API. Yes, I tried to removeParents and addParents like in example you post in javascript v2 and also v3 API and I can move all files from other folders to root easily, but not files from appDataFolder. I also try to update file with request body by changing parents parameter and title of file in v2 API which also works with all files except files in appDataFolder. So only thing that works is copy.Jan Valuštík

1 Answers

0
votes

No, it seems to be impossible. The current document doesn't mention about that, but the error message clearly says so. Thumb down for drive api.