title: Why Azure UploadFromStream does not work if I use MemoryStream (It works but length equals 0)?
body: <p>I have a class</p>
  
  <pre><code>public class TextCorpusFile
  {
      public int Id {get; set;}
      public string FileType {get; set;}
      public MemoryStream File {get; set;}
  }
  </code></pre>
  
  <p>If I try to upload a file to Azure Blob Storage, the length of the file equals 0. ( the file was created, but length is 0)</p>
  
  <pre><code>public void SendTextCorpusFileData(TextCorpusFile textCorpusFile)
  {
      //get container by default 
      CloudBlobContainer textCorpusContainer =
          ReturnTextCorpusFileContainer();
  
      CloudBlockBlob blockBlob = textCorpusContainer.GetBlockBlobReference(textCorpusFile.Id + POINT + textCorpusFile.FileType);
  
      blockBlob.UploadFromStream(textCorpusFile.File);
  
  }
  </code></pre>
  
  <p>But if I send files by bytes, it works well and the length is not 0.</p>
  
  <pre><code>public void SendTextCorpusFileData(TextCorpusFile textCorpusFile)
  {
      //get by default
      CloudBlobContainer textCorpusContainer =
          ReturnTextCorpusFileContainer();
  
      CloudBlockBlob blockBlob = textCorpusContainer.GetBlockBlobReference(textCorpusFile.Id + POINT + textCorpusFile.FileType);
  
      blockBlob.UploadFromByteArray(textCorpusFile.File.ToArray(),
          0,
          (int)textCorpusFile.File.Length);
  }
  </code></pre>
  
  <p>Why it works like this I can not understand (because UploadFromStream(Stream source and I am sure that <strong>MemoryStream : Stream</strong>) </p>
  
  <p>Can you explain ?</p>