We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

daveh0's avatar
daveh0
Explorer | Level 4
5 years ago

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...
  • Greg-DB's avatar
    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.