title: How to convert array of byte to original file (to provide download of file)
body: <p>I m using Opendialogbox to read the file. Then stored the file in byte[] array.</p>
  
  <p>file --> byte []
  byte[] --> stored on SQL AZure in varbinary(max) field.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>      OpenFileDialog ofd = new OpenFileDialog();
          if ((bool)ofd.ShowDialog())
          {
               FileStream fileStream = ofd.File.OpenRead());
  
                byte[]  buffer = new byte[fileStream.Length];
                 int read = 0;                             
              using (BinaryReader binaryReader = new BinaryReader(fileStream))
              {
                  do
                  {
                      read = binaryReader.Read(buffer, 0, Convert.ToInt32(fileStream.Length));
                      // Stored the File in byte[] Array buffer
                  } while (read &gt; 0);
              }
  
          }
  </code></pre>
  
  <p>Now I want to convert this byte array to the original file (like .doc,.txt,jpeg). i know the extension in which file is to be convert.</p>
  
  <p>SQL AZure  ---> byte[]     // done
   byte[]   ---> to original file.  // Problem </p>
  
  <p>Please give solution to download the file.</p>