cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know all about tools for creatives that work seamlessly with Dropbox, like Adobe? Well, check it out right here!

Dropbox files & folders

Get in sync with the Dropbox Community. Our members can answer all your questions on Dropbox files and folders. Join a discussion or start your own today.

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

Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Zain_
Helpful | Level 5

I would like to ask: Does Dropbox block the simultaneous and multiple downloads of the same file using the same NAT gateway IP address? For context, I am using the Java Apache library to download a specific file programmatically, but the download requests, which are more or less 400 instances, happen almost simultaneously; These virtual instances share the same gateway IP address. Is there a restriction imposed for such use? The thing is that majority of the files are successfully downloaded, but there are some files that seem to be successfully downloaded without any size i.e., the size is 0 bytes; thus, rendering those files corrupted. The file is a Microsoft Excel file and I have a basic plan for my account. 

 

Thanks!

1 Accepted Solution

Accepted Solutions

Re: Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Zain_
Helpful | Level 5

Hi @Здравко, thanks for the idea! I have resolved the issue. Previously, I was utilizing Apache Commons' FileUtils class to copy the file into the intended directory from my Dropbox file download link. Apparently, the URL is being redirected more or less twice -- first returns Response 301 then followed by 302. The redirection of the URL is not being handled by the external class, but the HTTP call still proceeded as it is technically not an error. Therefore, I had to manually handle the redirection to successfully download the file from the temporary location. 

View solution in original post

4 Replies 4

Re: Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Здравко
Super Collaborator | Level 20

Hi @Zain_,

To be clear what exactly is going on, better take a look on the real response in your code (an object of "HttpResponse" class) represented entire response (together header, status code, etc). When something goes wrong (i.e. some exception, for example), make a dump of the received response and see what's there. 😉 There should be precise information (to some extent) what's at all (including what's wrong).

Hope this gives direction.

Re: Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Zain_
Helpful | Level 5

Hi,

Thanks! I did check the response status whether 200 or something else. However, the response code is 200, the method to check if the file was physically present returns true, but the size is 0 bytes. As for the other useful info, I was only getting an exception message of "Can't open the specified file..." With this regard, I was thinking if there are some restrictions imposed by Dropbox. I'm still looking for some ways to understand what really is going on. 

Re: Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Здравко
Super Collaborator | Level 20

@Zain_ wrote:
... However, the response code is 200, ..., but the size is 0 bytes. ... I was only getting an exception message of "Can't open the specified file..." ... 

Hi @Zain_,

I think we are talking for different things. What you mean "size is 0 bytes"?!!! 🧐 Since you talk both for network traffic and a local file, what's this referred to actually? 🙄 It's unclear from your explanation! Did you see zero in HTTP header "Content-Length" or...? 🤔

Since you received code 200 (OK) as a response, the exception isn't related to the network representation of the file, definitely! What is the file your code don't has access to? 🧐 Make a dump to the exception. 😉 Such information should be there.

Re: Simultaneous and multiple downloads of the same file returns 0 bytes for some files

Zain_
Helpful | Level 5

Hi @Здравко, thanks for the idea! I have resolved the issue. Previously, I was utilizing Apache Commons' FileUtils class to copy the file into the intended directory from my Dropbox file download link. Apparently, the URL is being redirected more or less twice -- first returns Response 301 then followed by 302. The redirection of the URL is not being handled by the external class, but the HTTP call still proceeded as it is technically not an error. Therefore, I had to manually handle the redirection to successfully download the file from the temporary location. 

View solution in original post

Poll
Do you work or study in the creative industry? If so, which area?
If you use Adobe, don't forget to check out our latest integrations update here.
Who's talking

Top contributors to this post

  • User avatar
    Zain_ Helpful | Level 5
  • User avatar
    Здравко Super Collaborator | Level 20
What do Dropbox user levels mean?
Need more support?