jQuery file upload --Multiple File Input Fields in One Form
The plugin can be applied to a form with multiple file input fields out of the box. The files are sent to the server with the parameter name of the file input field clicked by the user.
The following is a short howto on how to add an additional file input field to the example:
In index.html duplicate the span tag with the class "fileinput-button" like this:
<form id="fileupload" action="php/index.php" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="span16 fileupload-buttonbar"> <div class="progressbar fileupload-progressbar"><div style="width:0%;"></div></div> <span class="btn success fileinput-button"> <span>Add files...</span> <input type="file" name="files[]" multiple> </span> <!-- Extra file input start /--> <span class="btn fileinput-button"> <span>Other...</span> <input type="file" name="files2[]" multiple> </span> <!--/ Extra file input stop --> <button type="submit" class="btn primary start">Start upload</button> <button type="reset" class="btn info cancel">Cancel upload</button> <button type="button" class="btn danger delete">Delete selected</button> <input type="checkbox" class="toggle"> </div> </div> <br> <div class="row"> <div class="span16"> <table class="zebra-striped"><tbody class="files"></tbody></table> </div> </div> </form>
Adjust the name attribute of your file input fields according to what is expected on your server-side handler.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2015-07-08 Step3 - How to: Host and Run a Basic Windows Communication Foundation Service
2015-07-08 Step2 - How to: Implement a Windows Communication Foundation Service Contract
2015-07-08 Step1 - How to: Define a Windows Communication Foundation Service Contract
2015-07-08 Getting Started Tutorial from msdn
2015-07-08 WCF - Consuming WCF Service
2015-07-08 WCF - Windows Service Hosting
2015-07-08 WCF - WAS Hosting