Renaming PHP Uploads
Thursday July 24, 2008
If you are allowing people to upload to your server, you may want to rename the files before they are saved to give them the appropriate prefix, or just to make sure the file name is unique. This script shows you how to rename files uploads.


Comments
go day boat america green boy minor busy america boy house
hi everybody ; I have a shortcut about rename file :=)
if(preg_match(’/(.*)\.(.*)/’,$_FILES[’afis’][’name’],$dizi) ) {
$format=$dizi[2];
}
$ids=mysql_query(”select id from film_info order by id desc limit 1″);
$ids_get=mysql_fetch_assoc($ids);
$id_f=$ids_get[’id’]+1;
$new_name=”".$id_f.”_afis.”.$format.”";
// degisen ad
$_FILES[’afis’][’name’]=$new_name;