Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Ron B.15's avatar
Ron B.15
New member | Level 1
10 years ago

iOS SDK not uploading to folder path

I'm using "restClient.uploadFile(file, toPath: destPath, withParentRev: nil, fromPath: sourcePath)", where file="someFileName", destPath="somePathOnMyDropboxAccount", and sourcePath="someLocalFilePath". But instead of the file uploading to the designated path, it uploads to "file/file", creating a folder of the same name as the file on my Dropbox root folder.

What I wanted to happen was to upload my file to a specific folder (that may or may not exist). How do I do that?

 

2 Replies

Replies have been turned off for this discussion
  • Ron B.15's avatar
    Ron B.15
    New member | Level 1
    10 years ago

    Unfortunately, the example you cited in the tutorial shows how to upload to the root directory. That isn't the problem I'm having. I needed to know how to upload to something other than the root directory.

    Through process of elimination, I figured out that I need to include the "/" prefix to my 'toPath:' parameter. Any path components before the "/" are apparently ignored.

    Thanks for your help anyway.

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!