HTML / PHP,上传的文件不被存储在$ _FILES [英] html/php, uploaded files not being stored in $_FILES

查看:135
本文介绍了HTML / PHP,上传的文件不被存储在$ _FILES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,用户提交对象的描述(包括图像),还有一个JavaScript为+1对象描述添加了一组额外的输入。表单标签是< form id =order_formname =表单标签是在$ _FILES中存储的文件信息。

order_formmethod =postaction =#>



文件类型输入是<输入类型=文件名称=order_image []/>


$ b

print_r($ _ FILES) ; return



array()



有没有人有一个想法,为什么这可能会发生。我很乐意收录任何可能与此问题相关的信息。

解决方案

您是否在表单中设置了正确的编码类型标签?

$ $ p $ $ $ $ c $< form enctype =multipart / form-datamethod =postaction = ...>


I have a form where a user submits the description of an object (including an image) and there is JavaScript that adds an additional set of inputs for +1 object description. When the form is submitted the file information is not stored in $_FILES.

The form tag is <form id="order_form" name="order_form" method="post" action="#">

The file type input is <input type="file" name="order_image[]" />.

print_r($_FILES); returns

array()

Does anyone have an idea as to why this might be happening. I will gladly include any other information that might be pertinent to this question.

解决方案

Have you set the correct encoding type in your form tag?

<form enctype="multipart/form-data" method="post" action=...>

这篇关于HTML / PHP,上传的文件不被存储在$ _FILES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆