Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: File Downloads from Apache Server Doesn't Show Total |
|
Author |
|
bsimecek
Joined: 14 Aug 2006 Posts: 5
|
Posted: Wed 02 May '07 5:41 Post subject: File Downloads from Apache Server Doesn't Show Total |
|
|
If you download a file from apache (it seems by default), the Total file size to download is not given to the client. I have tried this with mutiple browsers, so I know it isn't the client side. Is there a setting in config to to enable this? |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Wed 02 May '07 9:36 Post subject: |
|
|
It sends it on my 2.2
To make sure you can do:
Start -> Run
cmd
telenet IPHERE 80
then type:
GET /myfile.zip HTTP1/1
<return>
<return>
and see if the header is sent.
Mine gives:
Code: | HTTP/1.1 200 OK
Date: Wed, 02 May 2007 07:35:30 GMT
Server: jHTTP Server/3.1 PHP/5.2.0 DAV/2 mod_perl/2.0.2 Perl/v5.8.8
X-Powered-By: PHP/5.2.0
Vary: Accept-Encoding
Content-Length: 2689
Connection: close
|
so thats ok since the contnet-legth is set. It maybe absent when apache doesn't know it but for most fiels and even php pages it usually knows it. |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Wed 02 May '07 15:52 Post subject: it might be compression |
|
|
With Apache 2.2.4, the Content-length header is not sent when the file is compressed by the mod_deflate module.
This can cause a file download to have no "Total size" value.
If you have enabled mod_deflate, you may wish to check your httpd.conf for "SetOutputFilter DEFLATE" or "AddOutputFilterByType DEFLATE ..."
and make sure you are not compressing your download files with mod_deflate.
-tom- |
|
Back to top |
|
bsimecek
Joined: 14 Aug 2006 Posts: 5
|
Posted: Wed 02 May '07 16:47 Post subject: |
|
|
That was it (MODE_DEFLATE).
However, is there an option with apache to compress data and still show a total download size? |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Wed 02 May '07 17:05 Post subject: |
|
|
re: "is there an option with apache to compress data and still show a total download size"
No. This is because the entire file would need to be compressed first to learn the final compressed size.
Apache doesn't wait. It sends the file while compressing it, so it doesn't know the compressed size until the whole file has been sent.
Many (most?) files which are downloaded are already compressed and don't benefit much from additional Apache compression.
A good policy is to enable compression for text files which are executed or displayed by a browser (html, xml, JavaScript, etc)
but not for already-compressed files (zip, jpg, etc).
For example: Code: | AddOutputFilterByType DEFLATE text/html text/plain application/xml text/css application/x-javascript |
Have a look at the file mime.types to see which file extensions are associated with the various types.
-tom- |
|
Back to top |
|
bsimecek
Joined: 14 Aug 2006 Posts: 5
|
Posted: Thu 03 May '07 3:50 Post subject: |
|
|
Excellent Info...Thanks |
|
Back to top |
|
|
|
|
|
|