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

Forum Discussion

Mostafa Ezzat's avatar
Mostafa Ezzat
Explorer | Level 4
3 years ago

Displaying file from Dropbox into a WebApplication using Dropbox API

Hello, 
       I want to find the best way to view a file like a video or image from Dropbox into a Website using HTTP or Javascript SDK 

for example I'm trying at least to download a file using the shared link and CURL
I also have a question should I use double quotes or single quotes with CURL in the Doc of the website there is a Double quotes but I saw some API calls with single quotes

Basically, It's sync a folder's files which on Dropbox to the Website. 

curl -X POST https://content.dropboxapi.com/2/sharing/get_shared_link_file \
    --header "Authorization: Bearer <REDACTED> " \
    --header "Dropbox-API-Arg: {  \"path\":\"/Hi/drop.jpg\",\"url\":\"https://www.dropbox.com/s/tmziscnuzavon9a/drop.jpg?dl=0\"}"

It prints this error: {"error_summary": "shared_link_not_found/", "error": {".tag": "shared_link_not_found"}}
 
 
  • Greg-DB's avatar
    Greg-DB
    3 years ago

    Unfortunately, the Dropbox Chooser does not have an option for retrieving "direct" links that do not expire, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. As a workaround, you can use "preview" links, which don't expire, and modify them for direct access as documented here.

     

    Also, regarding the issue with the files being disabled, looking at your code, it seems the issue here is that you're setting sizeLimit: 1024, which is limiting the user to selecting only relatively small files. Please try removing that option and you should see larger files selectable.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    I see you're calling /2/sharing/get_shared_link_file and are supplying both the "url" parameter and "path" parameter. The particular shared link you're sending as the "url" is for a file though; in that case you should not also supply the "path" parameter. The "path" parameter is only for when you need to specify a relative path under a folder when the "url" you are supplying is for a folder, not a file. Try the call again without setting the "path" parameter.

     

    Also, I've redacted it from your post, but for future reference, do not share your access token.

    • Mostafa Ezzat's avatar
      Mostafa Ezzat
      Explorer | Level 4

      Thanks for response, If I may ask about something important. I have a website that I need to make the users of Dropbox to import their videos into the application itself by clicking a button and authenticate after that and then pick the folder they want to. 

      So What are my options relating to Dropbox API, In other words what are the best features that I should use. 
      Should I use sharing link and downloading the video or even can I someway fetch all the folder files into website.

      Thanks in advance.

       

      • Mostafa Ezzat's avatar
        Mostafa Ezzat
        Explorer | Level 4

        Btw, I also have Js SDK installed, I didn't make test yet but I think it would work normally. So I mean if my best options to use one of the SDK or HTTP it will be okay. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

If 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!