You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
daveh0
5 years agoExplorer | Level 4
script to transfer files from remote server directly to Dropbox
Hi - I have a script currently running on an Amazon Lightsail instance that copies files from 1 remote server ("remote Server 1") to a different remote server ("Remote Server 2") using a simple SCP c...
- 5 years ago
The Dropbox API itself doesn't offer a way to get files directly from SSH connections like this, but to clarify, note that the "path" parameter you're referring to is how you specify where in the connected Dropbox account you want to put the uploaded file. It is not how you specify where the actual file data to upload comes from.
You send the file data you want to upload to the Dropbox API /2/files/upload endpoint in the HTTPS request body. In this curl example, that's done via curl's '--data-binary' option. In this sample, you're telling curl to upload the data from the local file with the name "local_file.txt" from the current directory.
You might be able to connect scp or ssh to curl and pipe the data directly through to the Dropbox API endpoint, though I don't have a sample of how that might work. You'd need to refer to the ssh, scp, and/or curl documentation for more information.
Greg-DB
5 years agoDropbox Staff
The Dropbox API itself doesn't offer a way to get files directly from SSH connections like this, but to clarify, note that the "path" parameter you're referring to is how you specify where in the connected Dropbox account you want to put the uploaded file. It is not how you specify where the actual file data to upload comes from.
You send the file data you want to upload to the Dropbox API /2/files/upload endpoint in the HTTPS request body. In this curl example, that's done via curl's '--data-binary' option. In this sample, you're telling curl to upload the data from the local file with the name "local_file.txt" from the current directory.
You might be able to connect scp or ssh to curl and pipe the data directly through to the Dropbox API endpoint, though I don't have a sample of how that might work. You'd need to refer to the ssh, scp, and/or curl documentation for more information.
- daveh05 years agoExplorer | Level 4
Gotcha. Thanks for the correction regarding Path parameter - temporary moment of absent-minded-ness - I'm glad you got the point anyway. Working on my script now - I'll post the solution when it hits production.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 years agoIf 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!