Posted by Kimmo Laine on 06/02/05 07:05
"Exyle" <exyle@no.spam> kirjoitti
viestissδ:429e4905$1_1@spool9-west.superfeed.net...
> Hi, I'm working on an anti-leech script. I know there's a way to have a
> php script "translate" into a file placed outside the document root, but
> have no idea how to do it, any help would be appriciated.
>
step one: set headers
you need to set
header("Content-Disposition: attachment; filename=my_secret.file");
header("Content-type: something/something");
step two: stream the file
readfile("C:/my_secret_directory/my_secret.file");
And that's it.
--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears
eternal.erectionN0@5P4Mgmail.com
[Back to original message]
|