Forum Moderators: coopster

Message Too Old, No Replies

rename an upload file

how to rename an upload file

         

watermelon

1:16 am on Jun 20, 2003 (gmt 0)

10+ Year Member



hi, i hav written a upload file system. user can easily upload an image file. let's say a user upload a file called 'xyz.gif'. so, this file will be kept in a certain folder. then, this filename will be kept into my database.

my problem is, can i rename the filename before i keep it into certain folder? can i know how should i write the coding?

thank you.

DrDoc

3:36 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



move_uploaded_file($_FILES['userfile_one']['tmp_name'], "path/to/file.gif")

watermelon

4:18 am on Jun 20, 2003 (gmt 0)

10+ Year Member



can i know where i should put this coding?

mcc235

12:24 pm on Jun 20, 2003 (gmt 0)

10+ Year Member



The code that DrDoc suggested goes into the PHP script that your web form uses. Maybe an example from the manual [php.net] will help.