[英]Multiple files upload - Blueimp jQuery uploader
I use a jquery plugin name "blueimp jquery file upload" - https://github.com/blueimp/jQuery-File-Upload . 我使用一个jquery插件名称“ blueimp jquery文件上传”-https: //github.com/blueimp/jQuery-File-Upload 。
I was wondering how can i add dropdown values to the database for each file when uploading multiple files. 我想知道在上传多个文件时如何为每个文件的数据库添加下拉值。
I have used the original javascript template for uploading files and i modified it a little. 我已经使用原始的javascript模板上传文件,并且对其进行了一些修改。 It looks like this. 看起来像这样。
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<form id="#fileupload" action="server/php/" method="POST" enctype="multipart/form-data">
<tr class="template-upload fade">
<td>
<span class="preview"></span>
</td>
<td>
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div class="progress-bar progress-bar-success" style="width:0%;">/div>
</div>
</td>
<td>
<label class="title">
<select name="title[]" >
<option value="val1">val1</option>
<option value="val2">val2</option>
</select>
</label>
<label class="description">
<span>Description:</span><br>
<input name="description[]" class="form-control">
</label>
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start upload-file" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
</form>
{% } %}
</script>
I am trying to make it to work. 我正在努力使其发挥作用。 I spend a lot of time today but don't want to gave up. 我今天花了很多时间,但不想放弃。 If someone had expericne with this, please help me, give me direction. 如果有人对此有经验,请帮助我,给我指示。
i have found this but i cant figure it out how to make it work https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data 我已经找到了这个但是我不知道如何使它工作https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data
Thanks 谢谢
Best Regards, Darko 最好的问候,达科
请参阅功能handle_file_upload中的server / php / UploadHandler.php尝试连接到数据库并将文件详细信息保存在数据库中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.