<% Set theform = Server.CreateObject("SoftArtisans.FileUp") category1 = "'" & theform.form("category1") & "'" if category1 = "''" then category1 = "NULL" category2 = "'" & theform.form("category2") & "'" if category2 = "''" then category2 = "NULL" category3 = "'" & theform.form("category3") & "'" if category3 = "''" then category3 = "NULL" category4 = "'" & theform.form("category4") & "'" if category4 = "''" then category4 = "NULL" category5 = "'" & theform.form("category5") & "'" if category5 = "''" then category5 = "NULL" displayname = fixsql(theform.form("displayname")) description = fixsql(theform.form("description")) keywords = fixsql(theform.form("keywords")) if not trim(theform.Form("filename").UserFileName) = "" then theform.Path = Server.MapPath("\pdf") filename = Mid(theform.Form("filename").UserFilename, InstrRev(theform.form("filename").UserFilename, "\") + 1) theform.Form("filename").SaveAs theform.Path & "\" & filename end if restricted = theform.form("restricted") if restricted <> "" then restricted = replace(restricted, ",", "|") set objDB = OpenDatabase(false) SQL = "Insert into Files (Category1ID, Category2ID, Category3ID, Category4ID, Category5ID, DisplayName, Filename, Description, Keywords, Restricted) VALUES (" & category1 & "," & category2 & "," & category3 & "," & category4 & "," & category5 & ",'" & displayname & "','" & filename & "','" & description & "','" & restricted & "','" & keywords & "')" UpdateDB objDB, SQL objDB.close set objDB = nothing response.redirect("../files.asp") %>