Hi,
I am having a strange issue with WEB API on DNN7. I am trying to implement an uploader tool called Pluploader. The uploader fires an ajax call which works for me in Chrome but when I try the same thing in IE9 an error is returned of "Unauthorised"
here are the snippets Thanks in advance for the help
Mark
$.ajax({
url: sf.getServiceRoot('mySite') + "Upload/getPolicy",
type: 'POST',
data: pack,
beforeSend: sf.setModuleHeaders
}).done(function (response, status) {
if (status == "success") {
params[response.file] = { policy: response.policy, signature: response.signature }
}
}).fail(function (xhr, result, status) {
console.log(xhr, result, status);
Uh-oh, something broke: " + status);
});
[HttpPost]
[ValidateAntiForgeryToken]
public HttpResponseMessage getPolicy(policy submitted)
{
var now = DateTime.Now;
var key = submitted.key + submitted.file;
Dictionary<
string
, object> result = new Dictionary<
string
, object>();
ASCIIEncoding encoding = new ASCIIEncoding();
string policy = createUploadPolicy(now, submitted.alc, submitted.bucket, key);
result.Add("policy", Convert.ToBase64String(encoding.GetBytes(policy)));
result.Add("signature", createUploadSignature(policy));
result.Add("file", submitted.file);
//return result;
return Request.CreateResponse(HttpStatusCode.OK, result);
}