How to get PHP to rename files
-
I am in a situation where I need to manage files that multiple users won't rename. I think I can use PHP to make each entry into a database unique by adding a unique tag to the file name but I don't know how to do this. The file name would need to be updated before it was entered into the database and the dump folder. Any suggestions?
-
I am in a situation where I need to manage files that multiple users won't rename. I think I can use PHP to make each entry into a database unique by adding a unique tag to the file name but I don't know how to do this. The file name would need to be updated before it was entered into the database and the dump folder. Any suggestions?
why dont you create a database entry for each file then use the primary key of the database item to rename the file. //get uploaded file //create database entry //name //type ... what ever fields are relevent //get last insert id returns last primary key inserted // rename file to $last_insert_id.xyz rename( old file, last insert id ) th