Forum Moderators: phranque

Message Too Old, No Replies

Strange Windows PDF download problem

Works on Mac but not Win

         

Jaze

3:46 am on Sep 30, 2003 (gmt 0)

10+ Year Member



Hi all,

We're having strange problems with dowloading a pdf on Windows. NB: everything works fine on Mac.

What happens, try to download a PDF, resulting error message: File does not begin with '%pdf'

OK, check adobe forums, results in this page:
[adobeforums.com...]

We have eliminated these causes, yet the problem still remains on Windows only.

We realise all pdf's in same folder have the same problem - there is a .htaccess file with rewrite cond's and rules that keep the pdf's hidden from the site that it is on, but allows our other site to access it.

We turn the rewrite engine off, and everything works perfectly. Strange as everything was working perfectly on the Mac.

Does anybody have any ideas that we can try or why this might be happening? I have even gone as far as forcing the mime-type with not much luck...

DaveAtIFG

5:08 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



there is a .htaccess file with rewrite cond's and rules that keep the pdf's hidden[

We turn the rewrite engine off, and everything works perfectly

You have an error in your conditions or rules. If your rules are serving content based on "visitor type," different content to different browsers for example, look at those rules first.

jdMorgan

5:11 am on Sep 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jaze,

You might want to post the rewrite rule(s) that protect your pdf files (after snipping out real domain names) - something is going wrong that causes the downloaded content to not begin with "%PDF". A normal pdf file begins with "%PDF-" followed by major and minor version numbers, e.g. "PDF-1.2". So possibly, your server is prepending a header (or something) on the file contents. You might also want to check it by manually requesting the file with wannabrowser or similar, and looking at the raw server response. Perhaps a Mac can handle it or is more forgiving.

Jim

Jaze

5:24 am on Sep 30, 2003 (gmt 0)

10+ Year Member



Thank you for your responses. Thought I might be p'ing in the wind.

.htaccess file:

RewriteEngine on
# Primers
RewriteCond %{HTTP_REFERER}!^http://(www\.)?our-domain\.com [NC]
RewriteRule ^.*$ /notfound.php

There is a hyphen in the domain name.