Image import export

xiaoxiao2021-03-06  65

<% Response.buffer = trueformsize = request.totalbytes formdata = request.binaryread (formsize) bncrlf = chrb (13) & chrb (10) divider = leftb (formdata, clng (instrb (formdata, bncrlf)) - 1) datastart = INSTRB (FormData, Bncrlf & Bncrlf) 4 DataEnd = INSTRB (DataStart 1, Formdata, Divider) -DataStart MyData = MIDB (Formdata, DataStart, DataEnd)

Set conn = server.createObject ("adodb.connection") conn.connectionstring = "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & Server.mappath ("images.mdb") Conn.open

SET RS = Server.createObject ("AdoDb.Recordset") rs.open "Select * from [images] where id is null", conn, 1, 3 rs.addnew rs ("img"). Appendchunk MyData Rs.Update RS .close set = nothing set conn = Nothing%> "showimg.asp" file code is as follows:

<% response.expires = 0RESPONSE.BUFFER = TRUERESPONSE.CLEAR

ID = TRIM (Request ("ID")) Response.ContentType = "image / *" set rs_img = server.createObject ("adoDb.recordset") sql = "select img from timage where id =" & idrs_img.open SQL, CONN, 1, 1

IMG_SIZE = RS_IMG ("IMG"). ActualsizerSponse.binaryWrite RS_IMG ("IMG"). getChunk (IMG_SIZE) RS_IMG.CLOSE SET RS_IMG = Nothing Set Conn = Nothing%>

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

New Post(0)