I want users to be able to download blobs from my website. I want the fastest/cheapeast/best way to do this.
Heres what i came up with:
CloudBlobContainer blobContainer = CloudStorageServices.GetCloudBlobsContainer();
CloudBlockBlob blob = blobContainer.GetBlockBlobReference(blobName);
MemoryStream memStream = new MemoryStream();
blob.DownloadToStream(memStream);
Response.ContentType = blob.Properties.ContentType;
Response.AddHeader("Content-Disposition", "Attachment; filename=" + fileName + fileExtension);
Response.AddHeader("Content-Length", (blob.Properties.Length).ToString());
Response.BinaryWrite(memStream.ToArray());
Response.End();
I'm using memorystream now but im guessing i should go with filestream because off the blobs being, in some cases, large.. Right?
I tried it with filestream but I failed miserable.. Think you could give me some code for filestream?