Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You would have to implement the equivalent of the algorithm defined here:</p> <p><a href="http://msdn.microsoft.com/en-us/library/dd179428.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd179428.aspx</a></p> <p>However, there is an easier way that I recommend if possible. I would have your ASP application make a ASMX (or WCF equivalent call) to a .NET application that returns a shared access signature (SAS) with a short life (e.g. with 10 min expiry). Just pass the name of the PDF you will upload and have it calculate a signature for you with write access. Once you have the signature, you can simply PUT against it without worrying about calculating anything. If the PDF is very large (> 64MB), you will have an issue where you need to worry about breaking into blocks, but for smallish PDFs you can do a very simple PUT operation on the SAS without worrying about it.</p> <p>The code for this is trivial:</p> <pre><code>var blobName = "foo.pdf"; //taken from ASP app var blob = container.GetBlobReference(blobName); var sas = blob.GetSharedAccessSignature(new SharedAccessPolicy() { Permissions = SharedAccessPermissions.Write, SharedAccessExpiryTime = DateTime.AddMinutes(10) }); </code></pre> <p>The container in this case is whereever you want users to upload. The 'sas' variable will contain the querystring portion that you need to send. You just need to append it (e.g. blob.Uri.AbsoluteUri + sas).</p> <p>With this solution, your ASP app is ignorant of Windows Azure blob storage and the details and only your .NET app needs to know the key or how to calculate a SAS.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload