PHP上传图片,下面一段代码。我在两台服务器上测试,一台可以上传,提示上传成功。一台不能上传无报错
<?phperror_reporting(E_ALL&~E_NOTICE);/**Createdon2011-7-23**Tochangethetemplateforth...
<?php
error_reporting(E_ALL & ~ E_NOTICE);
/*
* Created on 2011-7-23
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
if(is_uploaded_file($_FILES['upfile']['tmp_name'])){
$upfile=$_FILES["upfile"];
$name=$upfile["name"];
$type=$upfile["type"];
$size=$upfile["size"];
$tmp_name=$upfile["tmp_name"];
$error=$upfile["error"];
}
//echo $name;
if($error=='0'){
move_uploaded_file($tmp_name,'upload/'.$name);
echo "上传成功!";
}
?>
<form action="upload.php" enctype="multipart/form-data" method="post" name="up">
上传文件:
<input name="upfile" type="file"/>
<input type="submit" value="上传"/><br/>
</form>
求解释一下
权限两台服务器的用户权限都一样,给的最高 展开
error_reporting(E_ALL & ~ E_NOTICE);
/*
* Created on 2011-7-23
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
if(is_uploaded_file($_FILES['upfile']['tmp_name'])){
$upfile=$_FILES["upfile"];
$name=$upfile["name"];
$type=$upfile["type"];
$size=$upfile["size"];
$tmp_name=$upfile["tmp_name"];
$error=$upfile["error"];
}
//echo $name;
if($error=='0'){
move_uploaded_file($tmp_name,'upload/'.$name);
echo "上传成功!";
}
?>
<form action="upload.php" enctype="multipart/form-data" method="post" name="up">
上传文件:
<input name="upfile" type="file"/>
<input type="submit" value="上传"/><br/>
</form>
求解释一下
权限两台服务器的用户权限都一样,给的最高 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询