dongshimao7115 2017-04-05 17:18
浏览 156

从多个文件输入单独上传文件 - 仅使用一个提交按钮

first of all sorry for my bad English. I have hit a point in my project that i can't finde a solution on, so I will ask for help.


First let me explain a little about what the project is:

The system is a big upload system for a customer. each file there are selected need a Title.

enter image description here

As you can see I have many "Chose File" that because there need to be a max number of files pr categories (this can be change invidually) and the Title (the box beside the orange upload) are Required if you have chose a file.

My problem:

Click upload on each category are ignoring so wanna make one button to push there activate the upload for all those files. that easy enough, but here it's come: at the Host this system run on the max "upload size" is 90MB so when I have multiple files at the same time, its hit really quick the max.

This is how the HTML looks:

<form method='POST' accept-charset='UTF-8' enctype='multipart/form-data' >
    <div class="inputs">
        <label for="uMP1">Vælg Fil</label>
        <input type="text" name='titles[]'>
        <!-- Thumbnail -->
        <div class="thumbnail" id="MP1"></div>
        <!-- File -->
        <input id="uMP1" name='files[]' type="file">
    </div>
    <div class="inputs">
        <label for="uMP2">Vælg Fil</label>
        <input type="text" name='titles[]'>
        <!-- Thumbnail -->
        <div class="thumbnail" id="MP2"></div>
        <!-- File -->
        <input id="uMP2" name='files[]' type="file">
    </div>
    <div class="inputs">
        <label for="uMP3">Vælg Fil</label>
        <input type="text" name='titles[]'>
        <!-- Thumbnail -->
        <div class="thumbnail" id="MP3"></div>
        <!-- File -->
        <input id="uMP3" name='files[]' type="file">
   </div>
   <input type="Submit" name='Upload' value="Upload">
</form>

Is there any there can help me make this script or know a plugin there can do this?

PS: Do not have access to the php.ini

  • 写回答

1条回答 默认 最新

  • dongyipa0028 2019-06-04 10:14
    关注

    Premise that I have never used PHP, but ASPNET Core 2.1 I also had a similar problem and the solution is to give different names for each input file. For example:

    <div class="inputs">
        <label for="uMP1">Vælg Fil</label>
        <input type="text" name='titles[]'>
        <!-- Thumbnail -->
        <div class="thumbnail" id="MP1"></div>
        <!-- File -->
        <input id="uMP1" name='files1' type="file">
    </div>
    <div class="inputs">
        <label for="uMP2">Vælg Fil</label>
        <input type="text" name='titles[]'>
        <!-- Thumbnail -->
        <div class="thumbnail" id="MP2"></div>
        <!-- File -->
        <input id="uMP2" name='files2' type="file">
    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么