I have a the php file: /var/www/html/dev/view_files_disply.php
This file accepts a POST argument which identifies $filename (example 1392_foobar.txt) of a file stored on the server at:
/var/www/html/files/1392_foobar.txt
This filename is generated by PHP and is therefore rather cryptic. I have more meaningful filenames stored in a database
example: 1392_foobar.txt -> foobar.txt
I would like the view_files_display.php script to send the appropriate file to the user, with the appropriate filename (foobar.txt), but to leave the file 1392_foobar.txt on the server unmodified for future requests.
I am currently considering copying the file and renaming it, and then using a header(location=) to redirect the user to the renamed file, but I'm not sure how to ensure that the temporary file is deleted afterwards.
Any suggestions? Thanks, Grant
Grant Rutherford wrote:
Hi there,
I would like to send an arbitrary file to a user. This file will be on the server in the PHP directory. I will also want to rename it before it is sent, but keep the old file with the old filename.
Any help is appreciated... Thanks, Grant
-- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 ================================ Iders Incorporated: Confidential ================================ Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php