Retrieving image from sql and saving to disk
Wondering if anyone could help me out.
I am able to retrieve the images we stored into our sql database. I am able to bring the image up to the browser. Is there a way to save the image to disk?
Here is a sample of my code to display to browser.
sqlStmt = "exec usp_aa_rd_Maintenance "
Set rsGetEmpPic = Connection.execute(sqlstmt)
IF NOT rsGetEmpPic.Eof THEN
' read picture length
nPicLen = rsGetEmpPic("length")
nPicLen = 0
' if there is a non-zero length image then display image
IF nPicLen > 0 THEN
sEmpPic = rsGetEmpPic("MUGSHOT")
I tried the SaveBinaryData(sEmpPic) but it keeps on saying "Write to file failed.".