Problem In Renaming A File
Posted: Mon Mar 17, 2008 11:39 am
Kindly Solve My Problem
Warning: rename(d:\xampp\htdocs\SAP/product_image/160px-Angelina_jolie_lugar.jpg,d:\xampp\htdocs\SAP/product_image/7.image/gif) [function.rename]: No such file or directory in D:\xampp\htdocs\SAP\cp\addProduct.php on line 30
Path Of File:D:\xampp\htdocs\SAP\product_image
$ROOT_PATH="d:\\xampp\\htdocs\\SAP";
$fname=$_FILES['userfile']['name'];
$ftype=$_FILES['userfile']['type'];
if(file_exists($ROOT_PATH."/product_image/$fname"))
{
rename($ROOT_PATH."/product_image/$fname",$ROOT_PATH."/product_image/$id".".".$ftype);
}
Warning: rename(d:\xampp\htdocs\SAP/product_image/160px-Angelina_jolie_lugar.jpg,d:\xampp\htdocs\SAP/product_image/7.image/gif) [function.rename]: No such file or directory in D:\xampp\htdocs\SAP\cp\addProduct.php on line 30
Path Of File:D:\xampp\htdocs\SAP\product_image
$ROOT_PATH="d:\\xampp\\htdocs\\SAP";
$fname=$_FILES['userfile']['name'];
$ftype=$_FILES['userfile']['type'];
if(file_exists($ROOT_PATH."/product_image/$fname"))
{
rename($ROOT_PATH."/product_image/$fname",$ROOT_PATH."/product_image/$id".".".$ftype);
}