rename file on download

Mariam's Avatar, Join Date: Sep 2007
Go4Expert Member
Then I upload the file, for example "MG_CV.doc" the php code renames the file to "38912831_7183791.doc" and then uploads it. In database are saved the old and new names of the files (MG_CV.doc, 38912831_7183791.doc).


After I call
<a href='MG_CV.doc'>download file</a>
I need on clicking on "download file" download 38912831_7183791.doc but in "save as dialog" must be "MG_CV.doc" how can I do this in PHP
pradeep's Avatar, Join Date: Apr 2005
Team Leader
What PHP script uploads your files? How do you serve i.e. allow download of these files through a PHP script or direct download?
Mariam's Avatar, Join Date: Sep 2007
Go4Expert Member
Upload script is not necessary. In database I have real name of the file(MG_CV.doc) and renamed file (38912831_7183791.doc).
The real file that exists in server is 38912831_7183791.doc. I need download 38912831_7183791.doc file.
I wrote <a href='MG_CV.doc'>download file</a>, by clicking on "download file" must be opened save dialog and be downloaded with this "MG_CV.doc" name
pradeep's Avatar, Join Date: Apr 2005
Team Leader
To provide the real name for the download either you have keep it in the same name or you have to pass the Content-Disposition header which should include the filename to be shown for Save As