Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Renaming file before send to user?


rocknbil - 4:41 pm on Jul 14, 2011 (gmt 0)


I have no idea how I would go about renaming the file to the original filename when a user requests to download it?


Surely you are storing the "hash name" to keep track of it, correct? Then as said, you open "hashname" from the file system and when you output the headers, use "original filename" in the headers as demonstrated. No need to rename anything.


Thread source:: http://www.webmasterworld.com/php/4339486.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com