【问题标题】:405 (Method Not Allowed) error while trying to upload with blueimp jquery upload widget尝试使用 blueimp jquery 上传小部件上传时出现 405(不允许的方法)错误
【发布时间】:2015-03-13 12:51:10
【问题描述】:

我想使用 blueimp jquery 上传小部件的基本版本。但我收到如下错误:

POST "../(my url)" 405(不允许的方法)

我的代码是这样的:

<input id="fileupload" type="file" name="files[]" data-url="../uploads/" multiple>

还有一个基本的上传代码是这样的:

$('#fileupload').fileupload({
    dataType: 'json',
    done: function (e, data) {
        $.each(data.result.files, function (index, file) {
            $('<p/>').text(file.name).appendTo(document.body);
        });
    }
});

这是什么错误。应该不是 data-url 是这样的吧?我想将上传的文件放到显示的 url 中。有趣的是,如果我在新选项卡中打开不允许的 url,它会显示相关的 url。关于这个问题没有错误。

【问题讨论】:

  • 已经找到答案了吗?

标签: jquery jquery-file-upload blueimp http-status-code-405


【解决方案1】:

你试过了吗?

$('#fileupload').fileupload({
    dataType: 'json',
    method:'post',
    done: function (e, data) {
        $.each(data.result.files, function (index, file) {
            $('<p/>').text(file.name).appendTo(document.body);
        });
    }
});

【讨论】:

    猜你喜欢
    • 2012-08-05
    • 2016-09-03
    • 1970-01-01
    • 1970-01-01
    • 2019-08-09
    • 2021-08-07
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    相关资源
    最近更新 更多