html/php, uploaded files not being stored in $_FIL

2019-03-01 14:59发布

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.

2条回答
\"骚年 ilove
2楼-- · 2019-03-01 15:30
<form enctype="multipart/form-data" method="POST">

be sure you include enctype

查看更多
手持菜刀,她持情操
3楼-- · 2019-03-01 15:46

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

<form enctype="multipart/form-data" method="post" action=...>
查看更多
登录 后发表回答