I am creating a small application where i am reading am image from the database, storing the image in a file, and then setting the Image Control ImageURL property to the created file
The code is pretty straight forward
Dim m_Bytes As Byte() = DirectCast(command.ExecuteScalar, Byte())
Dim strfn As String = "D:\" + Convert.ToString(DateTime.Now.ToFileTime()) + ".jpeg"
Dim fs As New FileStream(strfn, FileMode.CreateNew, FileAccess.Write)
fs.Write(m_Bytes, 0, m_Bytes.Length)
fs.Flush()
fs.Close()
Image1.ImageUrl = strfn
The image is getting created properly at the location but the image control does not render an image . I checked the source of the page and the image control was pointing to
<img id="Image1" src="D:\129901061171254403.jpeg" />
The src is pointing to the correct location...
Thanks in Advance....