Use data inventory to take pictures

xiaoxiao2021-03-06  135

Picture warehouse

<% 'gets the data byte size of the client sent FRMSIZE = Request.TotalBytes' by binary mode, FRMDATA = Request.binaryRead (frMsize ) 'Before removing actual data, the border character serial BNCRLF = ChRB (13) & chrb (10) Divider = Leftb (FRMDATA, CLNG (INSTRB (FRMDATA, BNCRLF)) - 1) DataStart = INSTRB (FRMDATA, BNCRLF & BNCRLF) 4DATAEND = INSTRB (DataStart 1, frmdata, divider) -DataStart 'Read Image Data MYDATA = MIDB (FRMDATA, DATASTART, DATAEND) Use image data into database strsql = "Select * from tblimages" set = server .CreateObject ("AdoDb.Recordset") RS.Open Strsql, CONN, 1, 3rs.AddNewrs ("Picdata"). Appendchunk mydatars.Updatecounts = rs.recordcount 1rs.closeconn.close%>

Read pictures

<% sid = request.queryString ("id") strsql = "select picdata from tblimages where id =" & Sidset RS = Server.createObject ( "Adodb.recordset") rs.open strsql, conn, 1 ,1Response.contettype = "image / *" dataize = rs (0) .actualsizeResponse.binaryWrite RS (0) .Getchunk (DataSize) rs.closeconn.close%>

转载请注明原文地址:https://www.9cbs.com/read-127186.html

New Post(0)