in reply to Serving files without revealing their location

Simple. the script should find the MIME type of the file in question, open it (the file), store the contents in a variable, then print the MIME header followed by the file contents. so the browser is never actually getting to the real file, the script is just printing it's contents to the browser. That should work, but i'm not 100% sure, what does everyone else thing?

______________________________________________
When I get a little money, I buy books. If I have any left over, I buy food and clothes.
-Erasmus

  • Comment on Re: Serving files without revealing their location

Replies are listed 'Best First'.
Re: Re: Serving files without revealing their location
by EvanK (Chaplain) on Jan 29, 2001 at 23:42 UTC
    oh, and I forgot to add, if you don't want the user to be able to spread the link, then have the script as say:
    http://www.site.com/cgi/bin/get.cgi?file=7&id=someencrypted_string
    where someencrypted_string is, say, the user's ip encrypted in des or something. or if you want to get really technical, say so they only have a certain amount of time to dl the file themselves, you could encrypt the date into it as well as the ip.  >:-]

    ______________________________________________
    When I get a little money, I buy books. If I have any left over, I buy food and clothes.
    -Erasmus