php文件上传怪问题,急急急!

ZXHCAO 2005-11-16 11:25:50

//
<form action="uploadfile.php" name="form1" ENCTYPE="multipart/form-data" METHOD="POST">
<tr>
<td height="25" bgcolor="ffffff" align="left"> 上传文件:
</td>
</tr>
<tr>
<td height="25" bgcolor="ffffff" align="left">  1.<INPUT TYPE="FILE" name="userfile" style="width:200pt; height:14pt">
</td>
</tr>
<tr>
<td height="25" bgcolor="ffffff" align="left">  2.<input type='submit' value='粘贴' style="width:80pt; height:14pt">
</td>
</tr>
</form>


//uploadfile.php
<?
echo $userfile;
?>
在uploadfile.php里有时能得到文件名,有时得不到文件名,既使是英文名,请问是怎么回事?
...全文
132 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZXHCAO 2005-11-20
  • 打赏
  • 举报
回复

是我的电脑问题,也不知道出了什么问题!放到服务器上就没有问题了。
zhwb36 2005-11-16
  • 打赏
  • 举报
回复
用这种方式访问
$_FILES['userfile']['name']
The original name of the file on the client machine.

$_FILES['userfile']['type']
The mime type of the file, if the browser provided this information. An example would be "image/gif".

$_FILES['userfile']['size']
The size, in bytes, of the uploaded file.

$_FILES['userfile']['tmp_name']
The temporary filename of the file in which the uploaded file was stored on the server.

$_FILES['userfile']['error']
The error code associated with this file upload. ['error'] was added in PHP 4.2.0

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧