主题:请教:无法上传exe或avi文件
编写一个上传文件的php代码
uploadfile.htm,代码如下:
<html>
<head>
<title>文件上传界面</title>
</head>
<body>
<table><center>
<form enctype="multipart/form-data" action="upload.php" method="post">
<tr>
<td><input type="file" name="uploadfile" size=30></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="提交"></td>
<td><input type="reset" name="reset" value="重置"></td>
</tr>
</form>
</center></table>
</body>
</html>
uploadfile.php,代码如下:
<html>
<head>
<title>文件上传代码</title>
</head>
<body>
<?php
$timelimit=60;
set_time_limit($timelimit);
$newfile="c:/phptemp/".$uploadfile_name;
If($uploadfile!= "none")
{
copy($uploadfile,$newfile);
unlink($uploadfile);
}
else {
echo"你没有上传任何文件";
}
echo $uploadfile_name."上传成功!";
?>
</body></html>
当上传图片或文本等一般格式时没有问题,上传成功。但上传exe或avi等文件时出现错误,错误提示如下:
Warning: unlink() [function.unlink]: Permission denied in C:\Program Files\Apache Group\Apache2\htdocs\upload.php on line 13
这是怎么回事,请高手指教!多谢!!!
uploadfile.htm,代码如下:
<html>
<head>
<title>文件上传界面</title>
</head>
<body>
<table><center>
<form enctype="multipart/form-data" action="upload.php" method="post">
<tr>
<td><input type="file" name="uploadfile" size=30></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="提交"></td>
<td><input type="reset" name="reset" value="重置"></td>
</tr>
</form>
</center></table>
</body>
</html>
uploadfile.php,代码如下:
<html>
<head>
<title>文件上传代码</title>
</head>
<body>
<?php
$timelimit=60;
set_time_limit($timelimit);
$newfile="c:/phptemp/".$uploadfile_name;
If($uploadfile!= "none")
{
copy($uploadfile,$newfile);
unlink($uploadfile);
}
else {
echo"你没有上传任何文件";
}
echo $uploadfile_name."上传成功!";
?>
</body></html>
当上传图片或文本等一般格式时没有问题,上传成功。但上传exe或avi等文件时出现错误,错误提示如下:
Warning: unlink() [function.unlink]: Permission denied in C:\Program Files\Apache Group\Apache2\htdocs\upload.php on line 13
这是怎么回事,请高手指教!多谢!!!