PHP邮件程序错误:无法打开流:没有这样的文件或目录
您好,我在尝试使用php mailer上载文件时收到以下错误 移动上传文件(C:/inetpub/vhosts/yoursite.com/httpdocs/userfiles/resumes/5007story1.pdf)[function.move上传文件]:无法打开流:第87行的D:\yoursite\wwwroot\jobseers.php中没有这样的文件或目录PHP邮件程序错误:无法打开流:没有这样的文件或目录,php,smtp,gmail,sendmail,phpmailer,Php,Smtp,Gmail,Sendmail,Phpmailer,您好,我在尝试使用php mailer上载文件时收到以下错误 移动上传文件(C:/inetpub/vhosts/yoursite.com/httpdocs/userfiles/resumes/5007story1.pdf)[function.move上传文件]:无法打开流:第87行的D:\yoursite\wwwroot\jobseers.php中没有这样的文件或目录 global $imagesname; global $image_type;
global $imagesname;
global $image_type;
$uid = rand(100,9999);
if(isset($_FILES["img"]["name"]))
{
$image_tempname= $_FILES['img']['name'];
$imgdir ="C:/inetpub/vhosts/yoursite.com/httpdocs/";// $_SERVER ["DOCUMENT_ROOT"];
//imgdir =$_SERVER ["DOCUMENT_ROOT"];
$imgname = $imgdir. 'userfiles/resumes/'.$uid.$_FILES['img']['name'];
if($imagesname != '')
{
$imagesname=$imagesname.','.$imgname;
$image_type=$image_type.','.$_FILES['img']['type'];
}
else
{
$imagesname=$imagesname.$imgname;
$image_type=$image_type.$_FILES['img']['type'];
}
$imgurl = 'userfiles/resumes/'.$image_tempname;
//print_r($_SERVER['PATH_TRANSLATED']);
move_uploaded_file ($_FILES['img']['tmp_name'], $imgname);
}
if(isset($_FILES["img"]['name']))
{
$filename=$uid.$_FILES["img"]["name"];
}
$fileField=$filename;
第87行是:
移动上传的文件($\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$imgname)您确定要保存文件的目录存在吗?例如,文件路径是否完全正确?var_dump($imgname)并检查img路径是否确实存在。@PhilCross,是的,我将域名更改为yoursite和yoursite.com以解决一些安全问题。经常会遇到此错误,要快速排除故障,请执行以下步骤:stackoverflow.com/a/36577021/2873507