1
votes

I am doing an upload via CORS to Amazon S3 with the Kendo Upload control. I'm having an issue with the fact that I need to grab a signature from my server, then add it to the 'data' for the event object of 'upload' handler I created. The problem is, of course, that in the handler I fire off an async request to get the signature, and the upload handler continues on it's merry way without the signature data i need. The published API has no 'upload()' or something command that I could call when my async request returns.

I saw an ASP-Kendo-S3 example somewhere, but it's not exactly clear from that code, how that signature is being obtained, and of course, I'm not using ASP.

1

1 Answers

0
votes

Kendo Upload has an onUpload event. In Kendo's asp.net example there really isn't anything specific to that framework that wouldn't port to anything else.

They populate the page initially with the profile (base64 encoded JSON).

To get a signature for that base64 encoded json profile they use this method (C#):

private static string Sign(string text, string key)
{
    var signer = new HMACSHA1(Encoding.UTF8.GetBytes(key));
    return Convert.ToBase64String(signer.ComputeHash(Encoding.UTF8.GetBytes(text)));
}

It looks pretty self explanatory to the point where you could port it to another language.