免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4883 | 回复: 5
打印 上一主题 下一主题

move_uploaded_file错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-03 10:24 |只看该作者 |倒序浏览
一个很简单的东西。怎么就是出错呢,可能是什么原因呢?
Possible file upload attack! Here's some debugging info: Array ( [file] => Array ( [name] => 20686.gif [type] => image/gif [tmp_name] => /tmp/phpheuRyg [error] => 0 [size] => 10698 ) )


程序如下:
$uploaddir='/opt/apache/htdocs/';
if (move_uploaded_file($_FILES['userfile']['name'], $uploaddir . basename($_FILES['userfile']['name']))) {
print "File is valid, and was successfully uploaded. Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
2 [报告]
发表于 2007-04-03 10:37 |只看该作者
最前面加上:
error_reporting(E_ALL);

论坛徽章:
0
3 [报告]
发表于 2007-04-03 10:54 |只看该作者
Notice: Undefined index: userfile in /opt/apache/htdocs/d5/up.php on line 9

Notice: Undefined index: userfile in /opt/apache/htdocs/d5/up.php on line 9
Possible file upload attack! Here's some debugging info: Array ( [file] => Array ( [name] => 20686.gif [type] => image/gif [tmp_name] => /tmp/phpIoTJO9 [error] => 0 [size] => 10698 ) )

未定义userfile?第九行是这个move_uploaded_file($_FILES['userfile']['name'],

怎么回事?菜鸟,见笑了

论坛徽章:
0
4 [报告]
发表于 2007-04-03 11:05 |只看该作者
我吧userfile改成Filedata了。我前面都有做判断if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE)。没提示出错啊,为什么到这里说没定义?

论坛徽章:
0
5 [报告]
发表于 2007-04-03 12:04 |只看该作者
$_FILES['Filedata']前端是通过FLASH传过来的,别人说没有定义input name,这里应该写什么呢?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
6 [报告]
发表于 2007-04-03 13:01 |只看该作者
这个就要靠你自己的。

不知道你的流程是什么。

文件不通过上传,不能用这个函数的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP