Learn how to make the most out of the Dropbox Community here 💙.
Learn how to make the most out of the Dropbox Community here 💙.
Hi ThatBritishOne,
Seems you cannot understand the idea of different types of upload strategies. You can use a single call upload (seems most suitable for you) and using /2/files/upload you can upload all files, one by one. If some file is bigger than 150MB, then you have to use upload session. Upload session (/2/files/upload_session/start) is NOT for upload multiple files, but upload one file in pieces, every one piece 150MB at most. Be careful here. 🙂 Seems you are mixing the idea here! Other option is upload multiple files in batch (/2/files/upload_session/start_batch) that let you finish multiple files at once and decrease chance for call conflicts (possible on high load - multiple applications try access/change the same account content simultaneously). Hope this gives direction at least. Something you might be source of mistake is your 'DROPBOX_API_KEY'. What this actually means???!!! The name suppose application key, but you are using it as an access token! Take care. Take in mind that access token need refresh and you didn't implement any handling with refresh token. 😉 You may consider such option.
Good luck.
Hello,
Thanks for the help, I managed to update the script so it for eaches over every file and uploads it.
The problem I'm having now is keeping the folder structure, as it uploads it as a file rather than creates a new folder each time.
Is there a way I can preserve the path to upload and create the folders automatically?
ThatBritishOne wrote:...
Is there a way I can preserve the path to upload and create the folders automatically?
The API creates folder structure automatically - no folder(s) containing file need creation explicitly (only empty folders, if any, need explicit creation). Check what 'path' have you set for each entry (need to match actual relative path and the Dropbox path format rule).
ThatBritishOne Здравко is correct, you can control the folder hierarchy where you upload a file by using the "path" value. For example, if you want to upload a file named "newbackup" into a folder named "10-24-2022" which is inside a folder named "Backups", the "path" value should be "/Backups/10-24-2022/newbackup".
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!