Gents,
I have this code which saves an "Image" to a SQL Server database:

vb.net Code:
  1. 'You have the images in the PictureBoxes, now you need to store it as a Reference Image
  2.                 'if the user has selected that option
  3.                 Dim ms2 As New MemoryStream()
  4.                 'Save the image to the MemoryStream
  5.                 DirectCast(CameraTable.Controls("camera" & z.ToString), PictureBox).Image.Save _
  6.                 (ms2, Imaging.ImageFormat.Bmp)
  7.                 Dim arrImage() As Byte = ms2.GetBuffer
  8.                 db.SaveReferenceImage(arrImage, z)

This basically stores a long string of text in the DB such as:

"0x0asdfwerlkjfasfalskdfjsfj.."

I am working on a PHP site at the moment that is having trouble reading that data to display the image, so I am attempting to not only save it to the DB, but also save it as a bitmap or other file type to the actual server.

How can I create an image file (not really picky on which file type) from the "arrImage()" data above?