Need some help handling file downloads.
| From: | Nicole Stevens | Date: | Tue, 15 Apr 2003 23:27:50 +0000 |
| Subject: | Need some help handling file downloads. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-144038@lists.php.net to get a copy of this message | ||
Hello,
I am new here and if this sort of thing has been asked before, please
forgive me.
I'm writing a PHP application which connects users and allows for sharing of
files. Users need to be able to upload files to the server and download them
from a personal area and a public area.
The user is logged in via a form and once logged in a cookie is set to keep
track of who they are and what their current state is.
The files in question can be of any type, and, are located in an area
protected from the public.
Files are presented in a dynamic tree-style display (in an IFRAME)
now, the problem I have is when a link is clicked for one of these files,
regardless of the header that I send with the appropriate mime type,
internet exploder wants to save the file as PHP file. (since that is the
URL, i.e., http://www.myserver.tld/gimmefile.php?dickandjane.doc)
What I would like, and I dont know if this is possible, is to have my script
force via headers (is this even possible?) the filename to be saved, and the
mime-type for the file.
I have thought of various methods of copying, temporarily, the file wanted
to a temp directory which is accessible and doing a redirect to that file,
but, I dont want to have something which cleans the garbage on occasion,
and, it really breaks the security of what I want to do.
I have thought about using Apache 2.0's mod_ext_filter stuff -- and wonder,
also, if that would be a viable way of handling this.
Any help on this is appreciated.
TIA,
Nicole
---
Nicole Stevens - nicole@ducksfeet.com