Hi,
My script is working ok file upload ok and after uploading i can rename the file but i need to rename file before uploading .. my script is
$uploaddir = '/home/mydomain/public_html/plugnpay/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
//echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
//echo "File is valid, and was successfully uploaded.\n";
} else {
//echo "Possible file upload attack!\n";
}
$file=$_FILES['userfile']['name'];
rename("/home/mydomain/public_html/plugnpay/".$file, "/home/mydomain/public_html/plugnpay/test.csv");
Please guid me that i rename the file and then it upload cos it is possible that where i am going to upload thier is same name file present so i want to rename before uploading..