bootstrap 逼死人的 input file multiple 多文件post只能接收到一个

Bootstrap 的 input file 多文件上传在实际使用中可能遇到只能接收到一个文件的问题。解决办法是在 file input 的 name 属性后加上 [],并设置 multiple="multiple"。JavaScript 中需配置 uploadUrl 为上传地址,同时确保 uploadAsync 设为 false,限制最大文件数 maxFileCount: 5,并隐藏上传按钮,只显示浏览按钮。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

html

<div class="input-append">
     <div class="uneditable-input">
              <i class="fas fa-file fileupload-exists"></i> <span class="fileupload-preview"></span>
     </div>
      <span class="btn btn-default btn-file"> <span class="fileupload-exists">更换</span>

<span  class="fileupload-new">选择文件</span>
 <input type="file" name="file1[]" id="file1" multiple="multiple" />
         </span> <a href="#" class="btn btn-default fileupload-exists"   data-dismiss="fileupload">删除</a>
</div>

<script>
                                $(document).on('ready', function() {
                                $("#file1").fileinput({
                          
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值