Upload files from dropbox/box account to my server

2019-08-11 07:28发布

问题:

I have an api to upload files to my server. I need to make iphone an app to transfer files from dropbox to my server.

My question is Do I necessarily need to download the files from dropbox/box account to iphone and then upload to my server using my api?

Or Can I skip the part of downloading the files to the device and directly upload from a dropbox/box account to my custom server?

Or Optionally keep only few files in sync between the iphone and dropbox, and upload the local copy of file to my server?

Or is there any other way of doing it?

Thanks in advance.

回答1:

If the user has authorized the Dropbox API app on the iPhone app itself, and so the Dropbox API access token resides there, one solution is to have the iPhone app make an API call to /media (in the official Dropbox iOS Core SDK this is loadStreamableURLForFile). This will return a temporary direct link to the file contents. You can then pass that link to your server and do the downloading there.