[英]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. 我正在尝试使用在tomcat中运行的服务的剩余api在浏览器(chrome)中下载大小为50mb的文件。 In the server I'm using httpservletresponse's output stream to write the file contents. 在服务器中,我正在使用httpservletresponse的输出流来写入文件内容。 Sometime, only partial file is being downloaded (less than 50MB) even though server returns 200 response code. 有时,即使服务器返回了200个响应代码,也仅下载了部分文件(小于50MB)。
Here are my question, 这是我的问题,
Response 200 is the standard response for successful HTTP requests . 响应200是成功HTTP 请求的标准响应。 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... 可能的错误有很多:读取文件时发生错误(是否检查了文件的可读性?),应用程序中的错误未返回正确的响应大小等等……
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.