为什么无法上传文件啊?

ko0lo0 2008-04-06 02:28:14


<?
if(!UploadAction):
?>

<html>
<head>
<title>
文件上传界面
</title>
</head>
<body>
<table>
<tr align="center">
<td>
<form enctype="multipart/form-data" name="SubmitForm"
Action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"><input
type="hidden" name="UploadAction" value="1">
</td></tr>
<tr align="center">
<td><input name="UploadFile" type="file" size="30"></td>
</tr>
<tr align="center">
<td><input name="sumbit" value="提交" type="submit"></td>
<td><input name="reset" value="重置" type="reset"></td>
</tr>
</form>
</table>
</center>
</body>
</html>

<?
else:
?>

<html>
<head>
<title>
文件上传代码
</title>
</head>
<body>

<?
$UploadAction=0;
echo "Good";
$TimeLimit=60;
set_time_limit($TimeLimit);

if(($UploadFile!="none"))
{
$UploadPath=AddSlashes(dirname($PATH_TRANSLATED))."\\UPLOAD\\";
$FileName=$UploadPath.$UploadFile_name;
if($UploadFile_size<1024)
{
$FileSize=(string)$UploadFile_size."字节";
}
elseif($UploadFile_size<(1024*1024))
{
$FileSize=number_format((double)($UploadFile_size/1024,1)."KB";
}
else
{$FileSize=number_format((double)($UploadFile_size/(1024*1024),1)."MB";}
if(!file_exists($FileName))
{
if(copy($UploadFile,$FileName))
{echo "文件 $UploadFile_name($FileSize)上传成功";}
else
{echo "文件 $UploadFile_name上传失败";}
unlink($UploadFile);
}
else
{echo "文件 $UploadFile_name已经存在!";}

}
else
{echo "你没有选择任何文件上传";}
set_time_limit(30);

?>


<br><a href="upload.php">返回</a>
</body>
</html>
<?
endif
?>


为什么不显示文件上传成功?
...全文
50 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
来得查理 2008-04-07
$_FILES
回复
迅睿CMS框架 2008-04-07
$_FILES
回复
zmouki 2008-04-06
move_uploaded_file($FileName,$UploadFile)试试看
回复
相关推荐
发帖
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
帖子事件
创建了帖子
2008-04-06 02:28
社区公告
暂无公告