title: How to save a Text/document file to specific folder using MemoryStream in asp.net using c#?
body: <p>I have a file path from Sharepoint Document Library. The FileStrem contains the stream bytes of file from server. Now i want to <code>Save file</code> from these bytes using MemoryStream to specific folder using C# in asp.net.</p>
  
  <pre><code>public byte[] FileStream { get; set; }
  </code></pre>
  
  <p><strong>Below code i am using to save the Image File from sharepoint. It works!</strong></p>
  
  <pre><code>MemoryStream mStream = new MemoryStream(analystPhotoObj.FileStream);
  Bitmap bitmap = new Bitmap(mStream);
  bitmap.Save(path + @"\MemberPhoto\" + analystPhotoObj.DocumentID + "." + analystPhotoObj.FileType);
  </code></pre>
  
  <p>Now the same thing i want to do for saving the <strong>text/document</strong> file.Only the thing is the  <strong>FILE TYPE</strong> is being changed  from *BITMA*P to <em>TEXT/DOCUMENT</em> file</p>
  
  <p>Help appreciated!
  Thanks!</p>