title: How to save image stream in c#?
body: <p>I have a imagestream in c# and i want to save them on the hard drive using the c# code. when i trying to do that i found Out of Memory whennever i have much enough Memory.</p>
  
  <p>so i am sure that my code leak the resources so can someone show me how i can do that</p>
  
  <pre><code>HttpPostedFileBase file
  
  
   file.SaveAs(location);
  
   Image image = Image.FromFile(location,false);
  
   image.Save(location, System.Drawing.Imaging.ImageFormat.Png);
  </code></pre>
  
  <p>image.fromFile line [3] caused Exception that out of Memory. can someone show me how i can do this in c#.</p>
  
  <p>The file come from PNG using Ajax Request are come as octet type as Mime type so how i can do that.</p>