Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am trying to make a program that uploads files to folders in a format based on a JSON object. I would like the folder to be created in Dropbox if it doesn't exist and if it does exist then put the file there. Is there a upload parameter that allows for creation of folders or placement depending on availibility.
Main Questions:
Any help would be greatly appreciated. I am in the research phase to see if this is even possible.
1. Yes, when uploading a file, you specify the full path where you want to upload it, including any parent folder(s). It sounds like you're using the JavaScript SDK (but please let me know if not), so for example, you would specify the 'FilesCommitInfo.path' value when calling filesUpload, or if using upload sessions, likewise in the nested 'FilesCommitInfo.path' values when calling filesUploadSessionFinish or filesUploadSessionFinishBatch.
For example, to upload a file named "example.doc" inside a folder named "documents", the path value would look like: "/documents/example.doc".
2. Yes, you can create folders using filesCreateFolder or filesCreateFolderBatch.
3. You can use filesGetMetadata to see if a particular item already exists. Or, you can use filesListFolder/filesListFolderContinue to list the contents of a folder, to see if any particular item(s) exist inside it.
Hi there!
If you need more help you can view your support options (expected response time for a 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!