Override uploadUrl in the imagebrowser

5 posts, 0 answers
  1. Austin
    Austin avatar
    2 posts
    Member since:
    Mar 2014

    Posted 29 Oct 2014 Link to this post

    For instance the thumbnail -

                                    thumbnailUrl: function (path, name) {
                                        //alert(path + name)
                                        path = myDir + "/Test/images/"
                                        return path + name;
                                    },

    - can be overridden by calling this function passing the variables. I am curious as to if there is a work around for "uploadUrl:" aswell.
    As of now it will not let me use a function or define a url inside the Definition.


    This will not work-
    uploadUrl: function (passedValue?) {
        //perform ajax
    }

    If this is possible i have not came acrossed what values are being passed.
    i know the return value must be formatted like this-
    { "name": "foo.png", "type": "f", "size": 12345 }


    This is the only format that will work and it doesnt call my Action.
    uploadUrl: "UploadFile.aspx/Upload",

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 31 Oct 2014 Link to this post

    Hello Austin,

    This functionality is not supported at this time. The uploadUrl option is passed to the upload widget's saveUrl, which does not support a function parameter. You can submit this as a feature request on UserVoice. Until it is supported, you might need to destroy and re-initialize the editor with the different options, or attempt to change the saveUrl dynamically by $("[data-role=upload]").data("kendoUpload").options.async.saveUrl = "foo"; -- although this may be considered a tad hacky.

    Regards,
    Alex Gyoshev
    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. Austin
    Austin avatar
    2 posts
    Member since:
    Mar 2014

    Posted 31 Oct 2014 in reply to Alex Gyoshev Link to this post

    Sweet Thanks Alex, 

    The uploading is now working although i do receive an "Error! The requested Url returned 200 - OK".

    How can i fix this?
    Im going through everything that is returned. No errors on the backend or on the request. Everything is Uploaded and Saved properly.

    Thank You, Austin

    Thanks, Austin
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 03 Nov 2014 Link to this post

    Hello Austin,

    This may happen if the response from the server is not valid JSON. The request from the upload is expecting such, because it has dataType: "json" set. Please verify that the response from the server is both valid JSON, and that is sent with an application/json Content-Type header.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. laf
    laf avatar
    1 posts
    Member since:
    May 2015

    Posted 29 May 2015 in reply to Alex Gyoshev Link to this post

    <meta http-equiv="Content-Type" content="application/json; charset=UTF-8"/>
    Error! The requested Url returned 200 - OK
    continued 

Back to Top
Kendo UI is VS 2017 Ready