when users uploaded images in my host automatic change the..
Posted: Sun Aug 31, 2008 5:28 pm
Hi
when users uploaded images in my host automatic change the name of file if exist .
i want the file to keep the same name, and new uploaded image have a new name .
i want when users upload images do not overwrite in same name.
for ex. in my host > pic.jpg and users uploaded > pic.jpg , change the name of new uploaded.
Please Help Me.....
My php script :
when users uploaded images in my host automatic change the name of file if exist .
i want the file to keep the same name, and new uploaded image have a new name .
i want when users upload images do not overwrite in same name.
for ex. in my host > pic.jpg and users uploaded > pic.jpg , change the name of new uploaded.
Please Help Me.....
My php script :
Code: Select all
<?php
//wwww.*****.com)
if(!is_dir("./img")) mkdir("./img", 0755);
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./img/".$_FILES['Filedata']['name']);
chmod("./img/".$_FILES['Filedata']['name'], 0777);
?>