<% response.buffer = true %> <% Timeout(1) %> <% Set Upload = Server.CreateObject("Persits.Upload") Upload.OverWriteFiles = False Upload.ProgressID = Request.QueryString("PID") '----------------------------------------------------------------- ' Capture uploaded file. Save returns the number of files uploaded '----------------------------------------------------------------- intCount = Upload.Save(server.mappath("../../Uploads")) if intCount < 1 then %> <% Response.End end if Set objFile = Upload.Files(1) set con = server.createobject("ADODB.Connection") con.open Application("CString") set rsLibrary = server.createobject("ADODB.Recordset") rsLibrary.open "SELECT * FROM Library", con, 1, 3 rsLibrary.AddNew() rsLibrary("L_SubcategoryID") = Upload.Form("SubcategoryID") rsLibrary("Description") = Upload.Form("Description") rsLibrary("FileName") = objFile.FileName rsLibrary("FileType") = objFile.Ext rsLibrary("UploadDate") = Now() rsLibrary.Update() rsLibrary.close set rsLibrary = nothing con.close set con = nothing Set objFile = Nothing response.redirect "default.asp?SubcategoryID=" & Upload.Form("SubcategoryID") & "&buster=" & server.URLEncode(now) %>