Rename File on Download

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cesarcesar
Forum Contributor
Posts: 111
Joined: Mon Oct 18, 2004 3:28 pm

Rename File on Download

Post by cesarcesar »

I have a php script that uploads a file to a directory. Since this program doesn't like spaces and crazy characters in the file name, the name gets changed to the current timecode (funky named-4.jpg to 1178253719.jpg). After the change i save both names to a db. This all works great. Next i have a page that reads the directory and displays the timecoded file name, when a user clicks it, it downloads fine. still works great.

I would like to find a way to rename the file on download, to the old saved named of the file (1178253719.jpg to funky named-4.jpg). How can i do this? Thanks.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

There is no need to post the same thread twice. I have deleted your duplicate thread.

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply