title: Upload file into Blob Azure
body: <p>I'm trying to upload files into blob Azure from an MVC app, I'm following <a href="https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/#upload-a-blob-into-a-container" rel="nofollow noreferrer">this</a> tutorial, and I'm stuck in this snippet: </p>
  
  <pre><code>using (var fileStream = System.IO.File.OpenRead(@"path\myfile"))
  {
      blockBlob.UploadFromStream(fileStream);
  }
  </code></pre>
  
  <p>How to make <code>@"path\myfile"</code> dynamic?? How to retrieve the real path of my file to put it in there? I accept any other suggestion too to upload to blob :)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As suggested I added the code inside my View:</p>
  
  <pre><code>@model RiPSShared.Models.RiPSModels.AgencyNote
  
  &lt;h2&gt;PostFile&lt;/h2&gt;
  
  &lt;form action="@Url.Action("PostFile", "AgencyNotes", new { NoteId=Model.aut_id})" method = "post" enctype="multipart/form-data"&gt;
      &lt;label for="file1"&gt; File name:&lt;/label&gt;
      &lt;input type="file" name="file" id="file1" /&gt;
      &lt;input type="submit" value="Submit" /&gt;    
  &lt;/form&gt;
  </code></pre>
  
  <p>And the full action controller:</p>
  
  <pre><code> public ActionResult PostFile(HttpPostedFileBase file, int NoteId)
   {
   CloudBlockBlob blockBlob = container.GetBlockBlobReference(path);
   using (Stream fileStream = file.InputStream)
              {
                  blockBlob.UploadFromStream(fileStream);
              }
   return RedirectToAction("Index");
  }
  </code></pre>