不允许使用jQuery File Upload(Blue imp)Symfony 2 405方法 [英] jQuery File Upload (Blue imp) Symfony 2 405 method not allowed

查看:120
本文介绍了不允许使用jQuery File Upload(Blue imp)Symfony 2 405方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这个捆绑软件在我的symfony 2项目中上传多文件:

I am using this bundle for a multi file upload in my symfony 2 project :

https://github.com/1up-lab/OneupUploaderBundle

与此插件结合:

http://blueimp.github.io/jQuery-File-Upload/

上传本身正在工作,但我也在控制台中收到此错误:

The upload itself is working but i also get this error in my console:

GET http://localhost/vdvinfra/web/app_dev.php/_uploader/gallery/upload 405 (Method Not Allowed)
665832b_jquery-2.0.3.min_1.js:6 x.support.cors.e.crossDomain.send665832b_jquery-2.0.3.min_1.js:6 x.extend.ajax7b52311_main_9.js:61 (anonymous function)665832b_jquery-2.0.3.min_1.js:4 l665832b_jquery-2.0.3.min_1.js:4 c.fireWith665832b_jquery-2.0.3.min_1.js:4 x.extend.ready665832b_jquery-2.0.3.min_1.js:4 S

因为该插件无法正常运行. (不显示进度条或消息).

Because of that the plugin is not working as it should be. (Not showing progress bars or messages).

该捆绑包在其文档中说,我需要在我的routing.yml中制作一条路线,如下所示:

The bundle says in its documentation that i need to make a route in my routing.yml like this:

oneup_uploader:
    resource: .
    type: uploader

config.yml:

config.yml :

oneup_uploader:
mappings:
    gallery:
        frontend: blueimp

我的简单输入字段:

<input id="fileupload" type="file" name="files[]" data-url="{{ oneup_uploader_endpoint('gallery') }}" multiple />

我的JavaScript:

my javascript:

    $(document).ready(function () {

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

    });

我已经更改了发布,放置和获取路线的方法. 还是行不通.

I already changed the route methods to post, put and get. Still not working.

我想知道是否有人可以解决这个问题!

I wonder if anyone can solve this problem!

谢谢

推荐答案

您使用什么Web服务器?我建议是Nginx.您必须修复您的配置文件.

What web server do you use? I suggest it is Nginx. You have to fix your config file.

这篇关于不允许使用jQuery File Upload(Blue imp)Symfony 2 405方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆