Forum Discussion

Himanshu_gofynd's avatar
Himanshu_gofynd
New member | Level 1
2 months ago

Randomness issue coming from dropbox - Facing issue in Image Upload

When we stream or request these URLs concurrently in bulk on our platform, they occasionally return HTML content instead of the expected image buffer. With the new content-type verification feature we introduced for files to be uploaded, the validation fails when Dropbox returns HTML instead of an image or binary file. This causes uploads to succeed intermittently.


const axios = require("axios"); // Define the cURL equivalent request const makeRequest = async () => { try { const urls = [ "https://www.dropbox.com/scl/fo/v3yos9i0yfi0rhz5d71fg/AA-x7YlVr36dRcIyKnmC-eA/X3VI09KBZ13VRR_1.jpg?rlkey=2eqhcmouhjb20eo364j6t9o5e&e=1&dl=1", "https://www.dropbox.com/scl/fo/v3yos9i0yfi0rhz5d71fg/AKRLiS-6DE2QicEIY-P7wCY/X3VI09KBZ13VRR_2.jpg?rlkey=2eqhcmouhjb20eo364j6t9o5e&e=1&dl=1", "https://www.dropbox.com/scl/fo/v3yos9i0yfi0rhz5d71fg/AA-x7YlVr36dRcIyKnmC-eA/X3VI09KBZ13VRR_1.jpg?rlkey=2eqhcmouhjb20eo364j6t9o5e&e=1&dl=1", "https://www.dropbox.com/scl/fo/v3yos9i0yfi0rhz5d71fg/AKRLiS-6DE2QicEIY-P7wCY/X3VI09KBZ13VRR_2.jpg?rlkey=2eqhcmouhjb20eo364j6t9o5e&e=1&dl=1", ]; const urlRequestPromise = urls.map(url => axios.get(url, { maxRedirects: 5, timeout:10000 })); const responses = await Promise.all(urlRequestPromise); responses.map(response => { console.log("Content Type - ", response.headers["content-type"]); }); } catch (error) { console.error("Error making request:", error); } }; // Create an array of promises to execute the request 100 times const requests = Array.from({ length: 10 }, () => makeRequest()); // Execute all requests in parallel Promise.all(requests) .then(() => { console.log("All requests completed"); }) .catch((error) => { console.error("Error with requests:", error); });

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hello Himanshu_gofynd

    Based on the code snippets you provided, it seems you are attempting to download files using a list of shared Dropbox links. Could you clarify whether the issue you’re encountering relates to downloading or uploading files to Dropbox?

    I tested the code snippet that you provided on my side but couldn’t replicate the issue you described. You mentioned encountering an unexpected HTML, could you render or inspect the HTML to better understand the information it contains? This might provide insights into the issue taking place.

  • Himanshu_gofynd's avatar
    Himanshu_gofynd
    New member | Level 1

    We are trying to upload files to our platform using these dropbox URLs. We are facing this issue when there are multiple number of URLs to be processed.
    Also i am not able to add the Html file as it is too big so i am attaching a drive link here:
    https://drive.google.com/file/d/1NQtTNXd8eZQiCigfIhmIX_ovsZrQ5GDf/view?usp=sharing
    Let me know if you can't access this.

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Hello Himanshu_gofynd,

      Thank you for getting back to us with this information. After reviewing the HTML file you provided, it appears you are encountering a shared link that has been temporarily disabled. This issue typically occurs when the daily bandwidth limits for a Dropbox account or plan are exceeded.

      Please note that shared links and file requests are banned temporarily (one day for the first time), and will be restored when the ban has expired (exceptions can occur). You should be able to use shared links and file requests afterwards.

      However, if you continue to encounter issues with a specific shared link, you may need to contact Support for further investigation and troubleshooting.

  • Himanshu_gofynd's avatar
    Himanshu_gofynd
    New member | Level 1

    Hi iNeil A shared link should ideally be accessible an unlimited number of times.
    If the link becomes inaccessible, even the image buffer shouldn't load, correct? This behavior appears to be somewhat inconsistent.

    • iNeil's avatar
      iNeil
      Icon for Dropbox Engineer rankDropbox Engineer

      Hi Himanshu_gofyndIf a shared link to an image is temporarily disabled , you won’t be able to load the image itself. If your sharing activity has been paused or interrupted, it’s likely because of one of the following reasons:

      • One of your files may contain malware.
      • You may have exceeded your daily limit for data sharing.
      • You may have reached the number of invites you can send per day.
      • One of your files may be subject to a copyright complaint.
      • One of your files may contain malicious content.
      • Your link has been shared or downloaded too many times in one day.

      For further information, please review our sharing limits and issues on our help center.

  • Himanshu_gofynd's avatar
    Himanshu_gofynd
    New member | Level 1

    Hi iNeil 
    Here the issue is that when we are trying to upload the failed files again it is getting succeeded partially, and so on. Additionally, the time interval between retries is often as short as 5 minutes. If the shared links to an image are temporarily disabled, the retry should not succeed. We are facing this issue intermittently.

  • iNeil's avatar
    iNeil
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi himanshu, I'm sorry to hear that you are still encountering issues with the shared links. Please contact our support team regarding this case and provide the problematic shared links so they can investigate and troubleshoot the issue further. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,940 PostsLatest Activity: 3 hours ago
350 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!