Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

brtdvrs's avatar
brtdvrs
Helpful | Level 5
3 years ago

Download not complete with json file

when I want to download a json file of 4,7MB the response is empty. I tried with the SDK using dbx.filesDownload({ path: file }) and with a HTTP request on 'https://content.dropboxapi.com/2/files/download'. In Fiddler I get the message: 

[Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned
3.261.611 bytes.
Other files in the same folder download without problem. Download from Dropbox site works fine, the JSON is validated ok.
What could be the problem ?
 

6 Replies

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

    brtdvrs wrote:

    when I want to download a json file of 4,7MB the response is empty. ...

    [Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned 3.261.611 bytes.
    ...

    Hi brtdvrs,

    Do you understand that you contradict to yourself? It cannot be empty and contain something in the same time! Also, make distinction between Dropbox API/SDK response and other part/library in your application response (as seems you're messing them). Isolate and post some code snippet related to the download only (where eventually an issue appears).

    Good luck.

  • brtdvrs's avatar
    brtdvrs
    Helpful | Level 5
    3 years ago

    this is the code:

    dbx.filesDownload({ path: file })
    .then(async function (response) {
    let reader = new FileReader();
    reader.readAsText(response.result.fileBlob);
    await new Promise(resolve => reader.onload = () => resolve());
    let griddata = JSON.parse(reader.result);
    FlexgridOrderFunctions(griddata, GridName);
    })
    .catch(function (error) {
    alert(error);
    });

    the result here is empty, but in Fiddler I got the message above. I catch no error.

     

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

    You can dump 'response.status' and 'response.headers' (most interesting is "dropbox-api-result" header, if any) to see what's going on (as a first step of course).

     

    Add: Why you need to construct new Promise at all?! Why don't you use the 'onload's body to perform rest of the work? 🤷 Would be more simple and stable (last but not least: it's the native way it works). Otherwise use the Blob's 'text' method. 🙋

  • hashirshabbir's avatar
    hashirshabbir
    Explorer | Level 4
    3 years ago

    The issue of an empty response when attempting to download a 4.7MB JSON file from Dropbox via both the SDK and an HTTP request, as well as the Fiddler error message indicating an incomplete server response of 3.261.611 bytes, suggests a potential problem with the server's response or network connectivity during the download process.

     

    Since other files in the same folder download without any issues and downloading from the Dropbox website works fine, it's possible that there might be a specific issue with this particular file's accessibility or format on the server side. Further investigation into the server's response and the specific file's settings in Dropbox may be necessary to pinpoint the exact problem.

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

    hashirshabbir wrote:

    ..., it's possible that there might be a specific issue with this particular file's accessibility or format on the server side. ...


    No hashirshabbir. All files, in perspective of API/SDK, are like "black boxes". The only difference is these "boxes" size. In particular case, the size is too small (much less than 150MB) size to matters.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!