HI All,
I'm trying to open a PDF from an Azure Bob. The first time I'm working with Azure Blob. After some googling I found some directions, but I can't get it to work. Preferably I would like to open the PDF in a new browser page. Second best: Download it to the default download folder.
The code I used:
CloudStorageAccount storageAccount = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials("AccountName", "Key"),true);
CloudBlobClient bclient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = bclient.GetContainerReference("Container");
CloudBlockBlob blob = blobContainer.GetBlockBlobReference("myPDF.pdf");
//The next line works; The file is downloaded to the folder, but in this case I would want to save it to the users download folder
blob.DownloadToFile("c:\\temp\\myPDF.pdf", System.IO.FileMode::Create, null, null, null);
//The next line is the preferred solution, but it gives me a link that does not work
new Browser().navigate(bclient.BaseUri.AbsolutePath);
Does anyone have a good example for me ?
Thanks,
Gerard