【问题标题】:Modifying blueimp jquery uploader修改 blueimp jquery 上传器
【发布时间】:2014-07-13 12:55:29
【问题描述】:

我正在修改此代码以便在我的 php web 中使用。我将代码添加到我的 index.php 中,但我不知道在哪里添加代码的 Client-side file upload initialization: 部分?

这是我用来使上传器插入 mysql 数据库的代码。

客户端文件上传初始化:

$('#fileupload').fileupload({
    url: 'server/php/'
}).on('fileuploadsubmit', function (e, data) {
    data.formData = data.context.find(':input').serializeArray();
});

【问题讨论】:

    标签: php jquery blueimp uploader


    【解决方案1】:

    在文件 ma​​in.js 中为下面的旧代码添加注释

    /* 
        // Initialize the jQuery File Upload widget:
        $('#fileupload').fileupload({
            // Uncomment the following to send cross-domain cookies:
            //xhrFields: {withCredentials: true},
            url: 'server/php/'
        });
    */
    

    添加新代码:

    $('#fileupload').fileupload({
        url: 'server/php/'
        }).on('fileuploadsubmit', function (e, data) {
         data.formData = data.context.find(':input').serializeArray();
    });
    

    【讨论】:

      猜你喜欢
      • 2017-04-14
      • 1970-01-01
      • 1970-01-01
      • 2015-02-23
      • 2017-08-30
      • 2013-04-29
      • 2015-09-29
      • 2014-06-18
      相关资源
      最近更新 更多