Retrieving image from sql and saving to disk
Hi,
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")
ELSE
nPicLen = 0
END IF
' if there is a non-zero length image then display image
IF nPicLen > 0 THEN
sEmpPic = rsGetEmpPic("MUGSHOT")
response.binaryWrite (sEmpPic)
rsGetEmpPic.Close
END IF
I tried the SaveBinaryData(sEmpPic) but it keeps on saying "Write to file failed.".
Please advise.
|