3

i already enable the Cors in my WEB API project ! all other methods inside the API controller can access from the other project !

but kendo uploader request can not reach to the controller method

 $("#files").kendoUpload({
            async: {
                xhrFields: {
                    withCredentials: true
                },
                saveUrl: 'http://localhost:23618/API/test/UploadAttachment',

                removeUrl: 'http://localhost:23618/API/test/RemoveAttachment',
                autoUpload: true
            },

            upload: function (e) {
                e.data = { contactID: 5 };
            },

            error: onError

        });

error

A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:23617' is therefore not allowed access.

here is my cors

 var cors = new EnableCorsAttribute("*", "*", "*");
            config.EnableCors(cors);
LittleDragon
  • 2,317
  • 2
  • 18
  • 23

1 Answers1

11

Trying it this way worked for me.. http://docs.telerik.com/KENDO-UI/api/javascript/ui/upload#configuration-async.withCredentials

$("#files").kendoUpload({
            multiple: false,
            async: {
                withCredentials: false,
                saveUrl: "url",
                autoUpload: true
            },
            success: onSuccess
        });