title: How to create byte array from HttpPostedFile
body: <p>I'm using an image component that has a FromBinary method. Wondering how do I convert my input stream into a byte array</p>
  
  <pre><code>HttpPostedFile file = context.Request.Files[0];
  byte[] buffer = new byte[file.ContentLength];
  file.InputStream.Read(buffer, 0, file.ContentLength);
  
  ImageElement image = ImageElement.FromBinary(byteArray);
  </code></pre>