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);
}
Problem In Renaming A File
Moderator: General Moderators
-
haseebmaqsood
- Forum Newbie
- Posts: 15
- Joined: Sat Jun 16, 2007 10:55 am
Re: Problem In Renaming A File
I think it might be a problem with your slashes on your path. You have both forward and backslashes
Also, as another thing, your extension for the rename "7.image/gif" I assume would need to be parsed from the filetype
Also, as another thing, your extension for the rename "7.image/gif" I assume would need to be parsed from the filetype
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: Problem In Renaming A File
Perhaps you could have put it this way:haseebmaqsood wrote:Kindly Solve My Problem
Are your permissions correct for reading/writing to files on your server?Could someone please help me figure out what is going wrong with this code?