Edges
Edges

Reputation: 317

Partial file is being downloaded from tomcat service

I'm trying to download a file of size 50mb in the browser (chrome) using rest api of service running in tomcat. In the server I'm using httpservletresponse's output stream to write the file contents. Sometime, only partial file is being downloaded (less than 50MB) even though server returns 200 response code.

Here are my question,

  1. Does server response 200 indicates successful file download or it just indicates that my request was processed and it has nothing to do with complete file download. Or server should return different status code if file is downloaded partially.
  2. What could be reasons for partial file download.

Upvotes: 0

Views: 344

Answers (1)

David
David

Reputation: 3055

Response 200 is the standard response for successful HTTP requests. The actual response depends on the request's content (and method as well); in your case it means that the server understood your request, which you're authorized to submit and successfully completed its task (which seems to be sending the file).

Possible errors are many: an error in reading the file (have you checked that it is readable?), an error in your application not returning the correct response size and so on...

Upvotes: 1

Related Questions