httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bing Du" <...@iastate.edu>
Subject Re: [users@httpd] I'm worried...
Date Tue, 29 Aug 2006 16:47:36 GMT
> Hi,
>
> I use Apache2 on Mandrake 10.1.
>
> I installed it recently. I build a simple web site which allows to
> download
> tips as PDF Files.
> I created the original PDF Files on my computer. I can read them with no
> problem.
> I transfered them to my website, first using Samba.
> I notice then that some files could not be correctly read : IE tells me
> (or
> rather Adobe Acrobat plugin) that "The file does not start with '%PDF-'" !
> I
> did the test on severeal computers...
> Ok, I thought the files were corrupted. I transferted them again but with
> ftp... same problem !
> I decided to transfert somewhere else the files on the same server, then I
> compared (using diff) each "bad" file with the new copy : no difference
> !!!
>
> For heaven sake, what's wrong !! Argh !!!
>
> Thanks for your support !

I don't think anything wrong with the PDF files themselves.  The problem
is they got compressed when they are transfered from the web server to the
browser.  Some browsers don't like it and hence the "The file does not
start with '%PDF-'"  error.  Google can tell more about that error.  We've
ever had that problem.  If the mod_deflate.so module is loaded in your
httpd configuration file, you can turn of compression for PDF files.  The
following config works for us.

===
# Turn on compression
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Or pdf
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

</Location>
===

Bing

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message