objCn.close set objrst=nothing set objcn = nothing %> <!--#include file="upload.asp"-->
showpic.asp ---------------------------------------- <% set objCn = server.createobject("adodb.connection") set objRst = server.createobject("adodb.recordset") objCn.Open "upload" objrst.Open "select what from pic where id=" & request("id"), objcn
if not objrst.eof then response.binarywrite objrst("what") end if
objrst.close objCn.close set objrst=nothing set objcn = nothing %>
upload.asp ------------------------------------------- <% Sub BuildUploadRequest(RequestBin) 'Get the boundary PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) 'Get all data inside the boundaries Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) 'Members variable of objects are put in a dictionary object Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") 'Get an object name Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) &nb