This topic is locked

Renaming Files Revisited

2/8/2011 6:07:51 PM
PHPRunner General questions
G
globiws author

The documentation and the forums have good info on renaming files on upload. This is important because files can be overwritten if different files with the same name are uploaded. It can also make file management easier.
However, I have a seemingly unique issue.
Instead of simply renaming files on upload, I am attempting to only do this behind the scenes. The end result I'm looking for is, if you're uploading a file called "myfile.jpeg", it will be saved on the server as "a3432432395gdsf342.jpeg" (just an example) BUT the list pages should still show "myfile.jpeg" as the file with a download link to the real file.
I have managed to rename the file, and store the original name and the new name, however, the list pages seem to automatically insert the file link.

The database stores "myfile.jpg" and on the generated site, the source becomes <a href="download.php?somestuff">myfile.jpg</a>
I cannot find this anywhere in the template files.
Is there a way to change this so that the resulting HTML has <a href="download.php?linkto-a3432432395gdsf342.jpeg">myfile.jpg</a>

?

Sergey Kornilov admin 2/9/2011

Here is the article that shows an example of renaming files after upload:

http://xlinesoft.com/phprunner/docs/rename_uploaded_file.htm
This should do the job.