You can detect the most recent version of the file from Dropbox using their API but you can not detect which files are new in Dropbox. So you need to manage this from your end not in Dropbox end. When you will add a file to Dropbox and you need to save the response meta data for me. I will your use your meta data to call dropbox api and will get the files here.
So, I just want to make a simple change from your flow:
- You will upload media file and will put into the dropbox. You will collect meta data file and will put this data into a database.
- I will check from your inserted record from database and will call the Dropbox api to get the file.
- I will download and save the file in a temporary folder
- From there I will call the Droplet Api to put the media. Here we have two other choice, we can use ftp or ssh. I would prefer to use ftp as it would be easy to handle for you as well. I will give you an option in config from where you will be able to change the credential of ftp.
- At last, after successful copy I will remove this metadata from the DB which we will insert in 1st step.
As I know and aware, Dropbox API had a limitation too and we can not copy or used API endpoint very frequently. So, if the number of files are huge in that case we will have to confirm and will have to check with the Dropbox API limit. Please let me know when we can discuss further so that we can check together the pain area.
Will wait for your feedback.