You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

alicera's avatar
alicera
Explorer | Level 3
3 years ago

how to make sure Dropbox link whether it can download

here is the code

 

```

if wget -q --method=HEAD ftp://ftp.somewhere.com/bigfile.gz;
then
echo "This page exists."
else
echo "This page does not exist."
fi

```

I try to use correct link and incorrect link  (dropbox)

It is still return "This page exists."

Desktop


  • alicera wrote:

    ...

    ```

    if wget -q --method=HEAD ftp://ftp.somewhere.com/bigfile.gz;
    then
    echo "This page exists."
    else
    echo "This page does not exist."
    fi

    ```

    ...


    Hm... 🤔 alicera, let's change it little bit:

    if wget -q --method=HEAD --max-redirect 0  https://www.dropbox.com/s/abcdefg/123?dl=0 ;
    then
    echo "This page does not exist."
    else
    echo "This page exists."
    fi

    Is it working now? 😜

  • Jay's avatar
    Jay
    Icon for Dropbox Staff rankDropbox Staff

    Hi alicera, thanks for messaging the Community.

     

    Could you clarify what you're trying to do?

     

    There isn't a direct method to test if a shared link to a file exists or not, since it would still generate a message on the Dropbox site, saying there isn't a file there.

     

    This will help me to assist further!

      • Jay's avatar
        Jay
        Icon for Dropbox Staff rankDropbox Staff

        As far as I'm aware, it isn't possible to determine if a file exists at a specific link. Entering the incorrect link means it wouldn't be possible to locate the file.

         

        If the file was deleted, the shared link would also be deleted, and can't be restored to the same link.


  • alicera wrote:

    ...

    ```

    if wget -q --method=HEAD ftp://ftp.somewhere.com/bigfile.gz;
    then
    echo "This page exists."
    else
    echo "This page does not exist."
    fi

    ```

    ...


    Hm... 🤔 alicera, let's change it little bit:

    if wget -q --method=HEAD --max-redirect 0  https://www.dropbox.com/s/abcdefg/123?dl=0 ;
    then
    echo "This page does not exist."
    else
    echo "This page exists."
    fi

    Is it working now? 😜

    • alicera's avatar
      alicera
      Explorer | Level 3

      Thanks for your help.

       

      Does it has the code for python with dropbox lib 

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        alicera, The questions you place here (including the last one) have their answers in other thread you asking for the same! Greg' proposal there is posted long before your last question. It's the same for all Dropbox supported SDKs (not just Python). There you can see too why/how my proposal works. 😉

About View, download, and export

Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.

Need more support

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!