Re: [users@httpd] I'm worried...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux