Reputation: 1800
I have dropbox filepicker in my project, once user select file i am receiving URL of the dropbox, now i want a content of that file using that URL in python.
here is the link which i received from dropbox picker : https://www.dropbox.com/s/ocissavtfvvdh2g/images.png?dl=0
I have checked this link https://sodocumentation.net/dropbox-api/topic/408/downloading-a-file
, but it will ask for the path, but i don't have path of the file, i just have URL of the file
Upvotes: 1
Views: 1474
Reputation: 1800
I just have to use 1
in dl querystring.
https://www.dropbox.com/s/ocissavtfvvdh2g/images.png?dl=1
like this
Upvotes: 1
Reputation: 16940
It sounds like you're using the Dropbox Chooser. If you just want direct access to the data of the selected file(s), you should use the "direct" link type.
Based on your sample link, I see that you're currently using the "preview" link type, which doesn't link directly to the file data, but rather a preview page.
Also, the sample code you linked to is for accessing files via the Dropbox API with an access token, not using a link returned by the Chooser, so it isn't relevant.
If you switch to the "direct" link type, you can use the returned link to directly access the file data just with an HTTP GET request, for four hours.
Alternatively, if you need access for longer than that, you can keep using the "preview" link type but modify the link as documented here.
Upvotes: 0
Reputation: 64
I would suggest you to use Dropbox API for your project. I made a similar project but using Google Drive API. Check bellow
https://www.dropbox.com/developers/documentation/python#install
Upvotes: 0