cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We've been busy working on some major updates to the Community, so check out what's changing, what’s staying the same and what you can expect from the Dropbox Community right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Download not complete with json file

Download not complete with json file

brtdvrs
Explorer | Level 4

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 6

Здравко
Legendary | Level 20

@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
Explorer | Level 4

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.

 

Здравко
Legendary | Level 20

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
Explorer | Level 4

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.

Здравко
Legendary | Level 20

@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.

mellisajhon
Explorer | Level 3

Здравко 
I also face the same issue.When I upload my Webite names cluster article into Dropbox, I face same issues some times. but since last month, it is okay.


Need more support?
Who's talking

Top contributors to this post

  • User avatar
    mellisajhon Explorer | Level 3
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    hashirshabbir Explorer | Level 4
  • User avatar
    brtdvrs Explorer | Level 4
What do Dropbox user levels mean?