Leendert wrote regarding 'Re: [SLE] Down load count?' on Fri, Oct 08 at 15:29:
On Friday 08 October 2004 21:33, Danny Sauer wrote: [...]
If you don't have log/server access beyond a file, you could write a CGI script (or similar) that makes an entry in a file, send you an email, puts somethign in a database, etc. Link to the CGI script, and have the CGI generate a redirect to the actual PDF. If someone finds the direct URL, they won't be counted, but you'll get a count of everyone who goes through the CGI.
You can serve a stream of bytes through a php script. If the 'Content-Type' header is right, the other site will believe it is a .pdf file (or so).
Mmmm, header("content-type", $type); fpassthru($handle);... :)
But boy, I hate those scripts. ;) I'd rather have a straight url of that .pdf file instead of having it served through a script. ;)
That screws up the "save as" in some of the browsers I've used. Even if you specify an attachment name in the header, some browsers insist on saving to "redirect.php" or similar. Using a redirect works more reliably, and if you do a *real* redirect instead of something with a "meta refresh"-type behaviour, it's transparent to the user. --Danny