<% Dim pRS Dim oFld Dim pfltNbrOfBlocks Dim pintFileLength Dim pintBlockSize Dim pintLeftOver Dim i Dim pstrMode Dim pstrAltImg Dim pintID Dim pintID2 Dim cData Set cDAta = new clsData Set cUtil = new clsUtility Const c_BLOCKSIZE = 4096 pstrMode = Request("MODE") pintID = Request("ID") pintID2= Request("ID2") pstrAltImg = Request("ALTIMG") cData.SQL = "sp_Image " _ & cData.ProcFld("MODE",pstrMode,2,True) _ & cData.ProcFld("ID",pintID,0,False) Set pRS = cData.RecordSet ' If Not (pRS Is Nothing) Then ' Response.ContentType = cUtil.Swap(pRS("ImgType"),"image/jpeg") ' Else ' Response.ContentType = "image/jpeg" ' End If ' Response.Expires = 0 ' Response.Buffer = True ' Response.Clear If pstrAltImg = "" Then pstrAltImg = "spacer.gif" If not (pRS Is Nothing) Then Set oFld = pRS("BinData") ' pintFileLength = oFld.ActualSize ' If pintFileLength = 0 Then ' Response.Redirect "/images/" & pstrAltImg ' End IF ' ' pfltNbrOfBlocks = pintFileLength \ c_BLOCKSIZE ' pintLeftOver = pintFileLength MOD c_BLOCKSIZE Response.BinaryWrite oFld ' Response.BinaryWrite oFld.GetChunk(pintLeftOver) ' ' For i = 1 to pfltNbrOfBlocks ' Response.BinaryWrite oFld.GetChunk(c_BLOCKSIZE) ' Response.Flush() ' Next Set oFld = Nothing Else Response.Redirect "/images/" & pstrAltImg End If Set pRS = Nothing %>