public BlobModel GetFile(Guid key)
 {
     var blobMetaData = Table.GetMetaData(key);
     var blobFileModel =
         new BlobModel
             {
                 UploadedOn = blobMetaData.Date,
                 BlobFile = Blob.GetBlob(blobMetaData.ResourceUri),
                 ResourceLocation = blobMetaData.ResourceUri
             };
     return blobFileModel;
 }
        public void PutFile(BlobModel blobModel)
        {
            var blobFileName = string.Format("{0}-{1}", DateTime.Now.ToString("yyyyMMdd"), blobModel.ResourceLocation);
            var blobUri = Blob.PutBlob(blobModel.BlobFile, blobFileName);

            Table.Add(
                new BlobMeta
                    {
                        Date = DateTime.Now,
                        ResourceUri = blobUri,
                        RowKey = Guid.NewGuid().ToString()
                    });

            Queue.Add(new CloudQueueMessage(blobUri + "$" + blobFileName));
        }
        public ActionResult UploadFile()
        {
            foreach (string inputTagName in Request.Files)
            {
            var file = Request.Files[inputTagName];

            if (file.ContentLength > 0)
            {
                var blobFileModel =
                    new BlobModel
                    {
                        BlobFile = file.InputStream,
                        UploadedOn = DateTime.Now,
                        ResourceLocation = Path.GetFileName(file.FileName)
                    };

                var blobManager = new FileBlobManager();
                blobManager.PutFile(blobFileModel);
            }
            }

            return RedirectToAction("Index", "Home");
        }