Hi All,
I've just started using ASPupload and can successfully submit files to a directory on the web server and form data to a database - i can then retrieve the form data and links to the files through an "edit" page to allow a user to adjust their content and resubmit the form and files, either as a draft (which just saves things) or as a real submission (which saves and emails their manager with links back to the content).
The problem I'm having is I can't figure out how to call asp upload with a sub process (currently there are two on this form - one for save as draft the other as submit for review)
And now to the code..
The initial form is loaded using a sub process with a query string to bring up the correct info from the database
<form ENCTYPE="multipart/form-data" METHOD="POST" name="form" action="<%=Request.ServerVariables("SCRIPT_NAME")% >">
The Sub process is called using a javascript button to call it - I've changed all teh request.form info to upload.form but no joy as I'm missing something - if anyone has run across this before and can help please let me know! My hunch is in using the request call for the id and script...but I could be off here..
<%Sub SubmitRFC()
Set Upload = Server.CreateObject("Persits.Upload")
' Uncomment this line if unique file name generation is necessary
' Upload.OverwriteFiles = False
' We must call Upload.Save or SaveVirtual before we can use Upload.Form!
Upload.Save "e:\uploads"
Set sFile1 = Upload.Files("sFile1")
Set sFile2 = Upload.Files("sFile2")
'On error resume next
'This will be used to submit the facilities managers updates
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open Application("Conn_String")
Call DBErrorHandler()
sSQL = "UPDATE tblRFC SET "
sSQL = sSQL & "date ='" & SQLdate(Upload.Form("date"),"/") & "', "
sSQL = sSQL & "sRFC_Name ='" & replace(Upload.Form ("sRFC_Name") ,"'","''") & "',"
sSQL = sSQL & "nRFC_sector ='" & replace(Upload.Form("nRFC_sector") ,"'","''") & "',"
sSQL = sSQL & "nRFC_type ='" & replace(Upload.Form("nRFC_type") ,"'","''") & "',"
sSQL = sSQL & " WHERE id = '" & request("id") & "';"
oConn.execute(sSQL)
Call DBErrorHandler()
Set oConn = Nothing
Cheers
Rich
New Zealand