No component upload pictures to database source code

zhaozj2021-02-16  57

********************* ONE.ASP page forms of ENCTYPE settings.

*************************** TOW.ASP page Get binary image information and upload it to the database.

<% PostedData = Request.BinaryRead (Request.TotalBytes) crlf = ChrB (13) & ChrB (10) tmpData = LeftB (postedData, CLng (InStrB (postedData, crlf)) - 1) dataStart = InStrB (postedData, crlf & crlf ) 4 dataEnd = InStrB (dataStart 1, postedData, tmpData) -dataStart starData = MidB (postedData, dataStart, dataEnd) Set Rs = Server.CreateObject ( "Adodb.RecordSet") Sql = "Select * From Picture" Rs. Open sql, cn, 3,3rs.addnewrs ("p_picture"). Appendchunk Stardatars.Updaters.closset RS = Nothing%>

******************** THREE.ASP page reads image information from the database and displays.

<% Set = server.createObject ("adoDb.recordset") SQL = "Select * from picture where p_pictureid =" & required ("id") RS.Open SQL, CN, 1, 1%> <% response.conteType = "image / gif"%> <% response.binaryWrite RS ("p_picture")%> <% rs.closset = Nothingcn.closset CN = Nothing%>

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

New Post(0)