Mauro, On 10/3/20 08:47, Mauro Tridici wrote: > Dear Users, > > I’m struggling with the problem mentioned in this mail subject. > When I try to download a 5GB sized file using two different tomcat web > applications on two different virtual machines, I noticed that the > browser download window shows a wrong file size (please take a look to > the attached picture). > Download starts regularly but it never ends. > > I tried to download different files using different web browsers, but > nothing changed. > It seems that this problem is not related to the web applications (as I > said, I’m testing two applications) and it is not related to a specific > tomcat version. > > I’m a “tomcat newbie”, could you please help me to understand the cause > of this issue? > You can find below some additional information about virtual machines, > os and tomcat. > > *1) virtual machine “serverA"* > > OS: CentOS Linux release 7.8.2003 > > TOMCAT: > Server version: Apache Tomcat/7.0.76 > Server built: Mar 17 2020 23:48:55 UTC > Server number: 7.0.76.0 > OS Name: Linux > OS Version: 3.10.0-1127.8.2.el7.x86_64 > Architecture: amd64 > JVM Version: 1.8.0_252-b09 > JVM Vendor: Oracle Corporation > > *2) virtual machine “serverB”* > > OS: CentOS Linux release 7.8.2003 > > TOMCAT: > Server version: Apache Tomcat/8.5.56 > Server built: Jun 3 2020 20:18:30 UTC > Server number: 8.5.56.0 > OS Name: Linux > OS Version: 3.10.0-1127.8.2.el7.x86_64 > Architecture: amd64 > JVM Version: 1.8.0_252-b09 > JVM Vendor: Oracle Corporation > > > Thank you in advance, > Mauro
Can you observe the HTTP response headers sent by the server along with the file? Also, how are you sending the file(s) from the application to the client? Are you using sendfile? Are you using the DefaultServlet? Or do you have your own code which reads the file and writes it to the client? Does the download always stop at the same point (byte count), or it is different each time? My guess is: 1. The code is in your application (or at least, not using Tomcat's code at all) 2. The code uses "int" variable to track the file size / set Content-Length response header 3. The file size is 5.4GiB 4. 5.4 GiB will overflow a 32-bit int by 3.4GiB resulting in a value of +1.4GiB final value 5. This value is being send to the client in the Content-Length header 6. The client is terminating the download after 1.4GiB (respecting the Content-Length header) -chris --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org