php - $_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
解决方案
如果您将表格与
<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>
推荐阅读
- python - 如何在与另一个与其他模型具有多对多关系的应用程序上向用户添加评论?
- javascript - 如何避免在javascript中生成重复的html代码
- php - 关于 ORDER BY 使用 Prepared Statements 的两个问题
- c - 为什么不能在 GNU C 基本内联 asm 语句中使用局部变量?
- regex - 带有可选子组的 RegEx 可选组
- c# - 如何在本地调用另一个函数应用程序?
- python - AssertionError: 字段 '' 已在序列化程序 '' 上声明,但尚未包含在 'fields' 选项中。可选的
- r - R传单 - 防止map_marker_click在某个图层上但允许标签
- typescript - 在 TypeScript 中,有没有办法省略真假类型?
- vue.js - 无法访问 vue 组件中的 axios.all