post icon

Adding unique name for uploaded files

$a = uniqid();

$a = “free-news-agency-“.$a;
$filename = $_FILES[image_field][name];
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$name = $a.”.”.$ext;

this is for using upload.class.php from http://www.verot.net/php_class_upload.htm

December 30, 2011

Comments are closed.

Leave a comment