php上传图片到测试机失败,但在本地上传成功。这是什么原因?在线等,知道的告诉请指导下菜鸟,谢谢
这是源码:
<?php
$myFile = $_FILES["myFile"];
//1、上传图片
$imagepath = NULL;
if($myFile["name"] != NULL)
{
$pointIndex = strrpos($myFile["name"],".");
$ext = substr($myFile["name"],$pointIndex);//扩展名
$fileName = md5(time()).$ext;//新文件名
$imagepath = "images/{$fileName}";//保存的路径
var_dump(move_uploaded_file($myFile["tmp_name"],"./{$imagepath}")) ;
}
?>
<form name="frm" method="post" action="shucai.php" enctype="multipart/form-data">
<table class="table" style="margin-left:90px;" cellpadding="5" cellspacing="15" width='700px' bgcolor="#D7D7D7">
<tr>
<td>新闻图片:</td>
<td><input type="file" name="myFile" size="30"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="添加">
<input type="reset" value="取消">
</td>
</tr>
</table>
</form>