Hi,
I am trying to upload my images using my ftp folder by php code.Begining it was worked very fine.recently i shifted my domain from one server to another one server now if i am trying upload any images it storing path into database and its not uploading that image into specified folder it showing error like this,
Warning: move_uploaded_file(cms\ offer3.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\Domains\ddd\wwwroot\cms\noticeboard_cms.php on line 36 PHP Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\phpE97F.tmp' to 'cms\ offer3.jpg' in C:\Domains\ddd\wwwroot\cms\noticeboard_cms.php on line 36
Please anyone can help me.
here is the code
<?PHP
$image_name = $_FILES['image']['name'];
$target_path1 = "cms/";
$target_path1 = $target_path1.$image_name;
if(is_uploaded_file($_FILES['image']['tmp_name']))
{
$userfile_type = $_FILES['image']['type'];
if (!($userfile_type =="image/pjpeg" OR $userfile_type=="image/gif"))
{
echo "Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";
exit;
}
if(move_uploaded_file ($_FILES['image']['tmp_name'],$target_path1))
{
//createThumbnails($image_name);
//chmod("$add",0777);
}
else
{
echo "Failed to upload file Contact Site admin to fix the problem";
exit;
}
}
}
?>