PHP5 $_FILES[][] 通知错误 - 未定义
我正在尝试使用 php5 脚本将文件上传到我的服务器。我收到一条通知错误未定义索引:qqfile
。
$_FILES['qqfile']['tmp_name']
但我不知道它是如何在之前的脚本中没有定义的。 “tmp_name”在数组中,但 qqfile 显示未定义...
I am trying to upload a file to my server using php5 script. And I am receiving an notice error Undefined index: qqfile
.
$_FILES['qqfile']['tmp_name']
But I don't know how it is not defined from the previous script. The "tmp_name" is there in the array, but qqfile is showing UnDefined...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果
$_FILES['qqfile']
不存在,那么['tmp_name']
也不存在。执行var_dump($_FILES)
看看里面到底有什么。请注意,如果您的文件上传表单没有以下格式,则文件上传将不起作用:if
$_FILES['qqfile']
doesn't exist, then neither could['tmp_name']
. Do avar_dump($_FILES)
to see what's really in there. Note that if your file upload form doesn't haven the following format, the file upload will NOT work:大多数时候是因为上传的文件大于 php.ini 中设置的限制。
尝试上传一个小文件,看看是否有效。
顺便说一句,PHP 中没有任何“未定义”类型。而且不可能存在
$_FILES['qqfile']['tmp_name']
但不仅仅是$_FILES['qqfile']
问候 php.ini 你应该看到这个值of:
你确定你有一个吗
?
Most of time it's because the file uploaded is greater than the limit setted into php.ini.
Try to upload a small file and see if it's works.
Btw there isn't any "undefined" type in PHP. And it's impossible that exists
$_FILES['qqfile']['tmp_name']
but not only$_FILES['qqfile']
Regards php.ini you should see the value of:
Are you sure you have a
?