Content-Length Header problem
I'm using LiteSpeed 4.1.12 and PHP 5.3.10.
When I try to send files greater than 2147483647 bytes (2GB) the download doesn't start.
Removing the header Content-Length the download does start but without file size.
It looks like a 32bits limitation but both programs and the OS (Linux 2.6.38-8-server Ubuntu x86_64) are 64 bits.
Any ideas what may be causing the problem?
If the download go through php, then 2G is the limit.
Max Dynamic Response Body Size (bytes) (Admin Console => Configuration => Server => Tuning) has hard limit of 2047MB.
For upload, there is no limit for Max Request Body Size (bytes) on 64bit system.
Thanks for the reply,
I think this isn't the problem. The content is sent in small pieces.
My Max Dynamic Response Body Size is set to 500M and I can usually set up to 2147483647, download size appears and download starts (and complete).
If I do not define the Content-Length header, download generally occurs without showing the file size.
I think it's a problem with the interpretation of Content-Length header.
Maybe a bug with integer type.
This is what I have:
If I change
header("Content-Length: ".$sz); to header("Content-Length: ".(2147483647));
It works, and to
Please help me
lsws looks ok for large content-length.
I tested on 1 of lsws server:
so may relate to php limit or lsapi.
although this is not directly related, for large file download, php can use a much more efficient way to send file to user, refer
Yes, directly download big files work. But when I send file with PHP, It doesn't work.
Can you help me to find where are the problem?
My PHP and LiteSpeed are 64 bits, I don't understand why this is happening.
Please look at this script:
In Apache works fine. When I try this with LiteSpeed, download don't start and use 96 percent of CPU.
I need to run some code inside of the download loop to do some verifications when every chunk was send. (control download speed based on number of users downloading)
With the header X-LiteSpeed-Location I can't do this.
I've checked with Wireshark, when I request the page with this script, It doesn't receive response.
When I uncomment //$sz-=1; it works. (because works with files <2147483648)
Can you test this script in your LiteSpeed server and check if it works?
tested with LSWS and Apache. None of them works for 2GB+.
On my apache works fine. Lsws doesn't.
Do you have any suggestions to make it work on lsws?
please force re-install 4.1.13. by our tests, this issue has been resolved. please confirm at your end.
|All times are GMT -7. The time now is 09:41 PM.|