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

Forum Discussion

Kate K.11's avatar
Kate K.11
New member | Level 1
10 years ago

file_copy is changing case when searching for local path

I'm writing a sync client (in Ruby) to copy a folder from local to Dropbox.  My code is as follows:

    file_copy(settings['local_folder'],settings['remote_folder'])

I get the following error:

    in `parse_response': Path '/home/user/projects/clients/' not found (DropboxError)

This is true; that folder doesn't exist.  It's '/home/user/Projects/Clients'

Is there any way to fix this *other* than renaming all of my local folders to lowercase?  This is on my personal Linux machine, so in this case, it would be a hassle for all other file references and scripts I have.

2 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Is the path "/home/user/Projects/Clients" a local path on your machine? The file_copy method takes two parameters, both of which are supposed to be remote paths in Dropbox (not local paths), in order to copy a file or folder already in Dropbox to another location in Dropbox. They should be paths relative to the root of the Dropbox. 

    In order to upload files and folders, you'll need to loop through the files and call one of the methods to upload, e.g., put_file, as necessary.

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!