This is a migrated thread and some comments may be shown as answers.

Override uploadUrl in the imagebrowser

4 Answers 100 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Austin
Top achievements
Rank 1
Austin asked on 29 Oct 2014, 03:08 PM
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",

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 31 Oct 2014, 03:21 PM
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!
 
0
Austin
Top achievements
Rank 1
answered on 31 Oct 2014, 04:37 PM
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
0
Alex Gyoshev
Telerik team
answered on 03 Nov 2014, 09:06 AM
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!
 
0
laf
Top achievements
Rank 1
answered on 29 May 2015, 09:04 PM

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

Tags
Editor
Asked by
Austin
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Austin
Top achievements
Rank 1
laf
Top achievements
Rank 1
Share this question
or