choosing the name to save a file as in a script
| From: | Blaster | Date: | Tue, 26 Dec 2000 21:46:36 +0000 |
| Subject: | choosing the name to save a file as in a script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31882@lists.php.net to get a copy of this message | ||
Hi everyone,
I've seen something very interesting on some site that would allow me to use
PHP-authentification to allow download of certain files.... Here's what the
link on the site looks like:
http://www.whatever.com/view.php3/filename.ext?id=17982
Now, the script that sends the file is view.php3. What this does is get a
file with id 17982, either by reading it from a database or something (not
important) and sends it back to the browser and the browser thinks it is
actually file "filename.ext"...
What I don't get is how can you pass "/filename.ext?id=17982" as an
argument? I tried it and the web server will of course look for file
"filename.ext", but it doesn't exist since view.php3 is obviously not a
directory...
Any ideas how this can be achieved? I thought it could be some kind of 404
error redirection to a php script, but then all bad links on the whole site
would be sent to that script and they don't appear to be (at least I get a
normal 404 error everywhere else)
Thanks for your time