cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

What is the difference between 'upload' and 'create_folder' ?

What is the difference between 'upload' and 'create_folder' ?

Douglas16
Explorer | Level 4
Go to solution

What is the difference between 'upload' and 'create_folder'?Because I type the 'upload' command passing a folder that don't exist, the command create automatically the folder with the file inside, in my view, the difference to the create_folder is that the create_folder just create an folder, already the 'upload' create the file that you set and the folder, if this don't exist yet...So when I need to upload a file in an determined folder, I don't need type de 'create_folder' command , is just type 'upload' and set the folder name and the file name, is it?

 

And about the 'upload' command, he should not do an upload of a file from the local machine instead of create a file?

 

Thanks for the attention, fellas!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The specifics will depend on your system, what language, what library/SDK, if any, you're using etc., but in general you'd use the local path you access the local file using whatever file access API your programming language supplies, and put the read data in the upload API call.

View solution in original post

5 Replies 5

Greg-DB
Dropbox Staff
Go to solution

Hi Douglas, it sounds like you have this right. When uploading a file, parent folders are automatically created if they don't already exist, so you don't need to explicitly create them first. The create_folder functionality exists so that you can create folders explicitly if you need them, without uploading any files.

 

I'm not sure I understand your second question though. Can you elaborate? Thanks in advance! 

Douglas16
Explorer | Level 4
Go to solution

Thanks for the reply, my friend.
On the second question, let's go:

 

When I use the upload command, I create a file, right? What I means is: I spected that to use this command I should set a file which is on my local machine and his path, but if I write a file name that does not exist in my local machine the command make the 'upload' even so...So the command is not creating instead of uploading the file?

 

I hope it has become clear, thanks again!!

Greg-DB
Dropbox Staff
Go to solution
When you upload a file to Dropbox using the Dropbox API, it will create the file in Dropbox, if it doesn't already exist. (If it does already exist, the API can also update the file with the new data.)

That is unrelated to the state of your local filesystem. When making the upload API call, you can supply data from wherever you want, for example, from a local file, from data in memory, generated on the fly, etc. The Dropbox API only sees the data that you send it, and doesn't know if/how it was stored on your local client.

Douglas16
Explorer | Level 4
Go to solution

Hmmm, I got it, so, how I do to upload a file in a determinated folder of my local machine to the dropbox using this command 'upload' ? I means: how or where I shoul set the path of local file?

Greg-DB
Dropbox Staff
Go to solution

The specifics will depend on your system, what language, what library/SDK, if any, you're using etc., but in general you'd use the local path you access the local file using whatever file access API your programming language supplies, and put the read data in the upload API call.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Douglas16 Explorer | Level 4
What do Dropbox user levels mean?