Image Selector always shows 405 method not allowed

5 posts, 0 answers
  1. Chen
    Chen avatar
    3 posts
    Member since:
    Jan 2015

    Posted 18 Jan 2015 Link to this post

    Hi , I just use the sample editor HTML

    and click insert image ,always shows 405 method not allowed 

    how can i solve this problem??


    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
            <link rel="stylesheet" href="Content/kendo.common.css" />
        <link rel="stylesheet" href="Content/kendo.default.css" />
        <link rel="stylesheet" href="Content/kendo.dataviz.css" />
        <link rel="stylesheet" href="Content/kendo.dataviz.default.css" />
        <script src="Scripts/jquery-1.10.2.js"></script>
        <script src="Scripts/kendo.all.js"></script>
    </head>
    <body>
            <div id="example">
     
                <div class="box">
                    <p>Allowed file types for the Image browser are: jpg, jpeg, gif, png</p>
                    <p>Allowed file types for the File browser for this demo are: txt, doc, docx, xls, xlsx, ppt, pptx, zip, rar, jpg, jpeg, gif, png</p>
                </div>
     
                <textarea id="editor" rows="10" cols="30" style="height:440px">
         
                    </textarea>
                <script>
                    $(document).ready(function() {
                        // create Editor from textarea HTML element with default set of tools
                        $("#editor").kendoEditor({
                            tools: [
                                "insertImage",
                                "insertFile"
                            ],
                            imageBrowser: {
                               messages: {
                                dropFilesHere: "Drop files here"
                               },
                               transport: {
                                    read: "/test/",
                                    destroy: {
                                        url: "/test/",
                                        type: "POST"
                                    },
                                    create: {
                                        url: "/test/",
                                        type: "POST"
                                    },
                                    thumbnailUrl: "/test/",
                                    uploadUrl: "/test/",
                                    imageUrl: "/test?path={0}"
                               }
                            },
                            fileBrowser: {
                                messages: {
                                    dropFilesHere: "Drop files here"
                                },
                                transport: {
                                    read: "/kendo-ui/service/FileBrowser/Read",
                                    destroy: {
                                        url: "/kendo-ui/service/FileBrowser/Destroy",
                                        type: "POST"
                                    },
                                    create: {
                                        url: "/kendo-ui/service/FileBrowser/Create",
                                        type: "POST"
                                    },
                                    uploadUrl: "/kendo-ui/service/FileBrowser/Upload",
                                    fileUrl: "/kendo-ui/service/FileBrowser/File?fileName={0}"
                                }
                            }
                        });
                    });
                </script>
            </div>
     
     
    </body>
    </html>
  2. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 21 Jan 2015 Link to this post

    Hi Chen,

    "Method not allowed" means that the client-side scripts are executing GET requests, while the server code expects a POST request, or vice-versa. Please verify.

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Chen
    Chen avatar
    3 posts
    Member since:
    Jan 2015

    Posted 21 Jan 2015 in reply to Dimo Link to this post

    Hi Dimo 

    ths for reply.

    how can I change type from POST to GET??

    I change the [type: "POST"] to [type: "GET"] , it's still get POST 405 method not allowed.


  5. Chen
    Chen avatar
    3 posts
    Member since:
    Jan 2015

    Posted 21 Jan 2015 in reply to Dimo Link to this post

    Hi Dimo 

    imageBrowser: {
         transport: {
            read: "/imagebrowser/read"
          }
    }

    the value of transport.read is a Web API??
    if it is, is there any sample of the read , destroy and create Sample Code??
  6. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 23 Jan 2015 Link to this post

    Hello Chen,

    I am afraid we do not have an ImageBrowser example with a Web API. No matter what the server implementation is, you can configure the ImageBrowser's transport and schema to be compatible.

    The request type can be changed, according to the documentation:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#configuration-imageBrowser.transport.read.type

    The request type can be set for all actions, in fact you are already doing this for most of them.

    Regards,
    Dimo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready