【问题标题】:Multiple files upload - Blueimp jQuery uploader多个文件上传 - Blueimp jQuery 上传器
【发布时间】:2014-07-10 22:49:29
【问题描述】:

我使用一个 jquery 插件名称“blueimp jquery 文件上传”-https://github.com/blueimp/jQuery-File-Upload

我想知道在上传多个文件时如何将下拉值添加到每个文件的数据库中。

我使用了原始的 javascript 模板来上传文件,并对其进行了一些修改。看起来像这样。

<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>

我正在努力让它发挥作用。我今天花了很多时间,但不想放弃。如果有人有这方面的经验,请帮助我,给我指导。

我找到了这个,但我不知道如何让它工作 https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data

谢谢

最好的问候, 达科

【问题讨论】:

    标签: javascript php jquery css blueimp


    【解决方案1】:

    查看函数handle_file_upload中的server/php/UploadHandler.php尝试连接db并将文件详细信息保存在数据库中

    【讨论】:

    • 已经有我希望你使用的标题属性,你可以在上面的下拉列表中看到:)
    猜你喜欢
    • 2019-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-25
    • 1970-01-01
    • 1970-01-01
    • 2017-04-14
    • 2013-04-29
    相关资源
    最近更新 更多