首页 > 解决方案 > $_FILES 只上传 1 个文件

问题描述

              <label class="labelFile">Bestand kiezen...</label>
                <input type="file" name="images_1" class="fileChoose" accept="image/*"></br></br></br>
                <label class="labelFile">Bestand kiezen...</label>
                <input type="file" name="images_2" class="fileChoose" accept="image/*"></br></br></br>

它只填充第一个图像,第二个图像给出错误:“4”,如何修复它,我想要多个输入字段而不是 1 个:D

标签: php

解决方案


如果您将表格与

<form method="POST" enctype="multipart/form-data" >

有两件物品退回给你试试这样

<?php
var_dump($_FILES['images_1']);
var_dump($_FILES['images_2']);
?>
<form method="POST" enctype="multipart/form-data" >
    <label class="labelFile">Bestand kiezen...</label>
    <input type="file" name="images_1" class="fileChoose" accept="image/*"></br></br></br>
    <label class="labelFile">Bestand kiezen...</label>
    <input type="file" name="images_2" class="fileChoose" accept="image/*"></br></br></br>
    <button value="ppp" type="submit">send </button>
</form>

推荐阅读