LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 689|回复: 2

help!!! (PHP)

[复制链接]
发表于 2003-8-18 10:41:53 | 显示全部楼层 |阅读模式
<head>
<title>Uploading...</title>
</head>
<body>
<font color="555555" size+=9>Uploading...</font>
<br><br>
<?
if($uploadfile=="none")
{
echo "ERROR: no file upload.";
exit;
}
if($_FILES['uploadfile']['size']==0)
{
echo "ERROR: file is zero length.";
exit;
}
if($_FILES['uploadfile']['type']!="text/plain")
{
echo "ERROR: file is not plain text.";
exit;
}
if(!is_uploaded_file($uploadfile))
{
echo "ERROR: possible file upload attack.";
exit;
}
$upfile="/usr/local/apache/htdocs/personal/".$_FILES['uploadfile']['name'];
if(!move_uploaded_file($_FILE['uploadfile']['tmp_name'],$upfile))
{
echo "ERROR: could not move file into directory.";
exit;
}
echo "File uploaded successfully.<br><br>";
?>
</body>
</html>



it always say that:ERROR: file is zero length. why?

upload.html code:
<html>
<head>
<title>Upload</title>
</head>
<body>
<center>
<font color="55555" size+=9>Upload programme and file</font>
</center>
<hr width="70%" size=2>
<br><br>
<form type="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Upload this file:<input name="uploadfile" type="file">
<input type="submit" value="Upload">
</form>
</body>
</html>
发表于 2003-8-18 16:10:20 | 显示全部楼层
这个问题真是很古怪,我的也是一样,这次重新安装了下系统,再次重新编译了PHP后,居然就可以了。
 楼主| 发表于 2003-8-18 17:44:17 | 显示全部楼层

you mean I should reinstall my OS???

you mean I should reinstall my OS???
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表