469,950 Members | 1,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Problem calling ASPUpload with a Sub

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
Feb 7 '07 #1
0 999

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by John Rebbeck | last post: by
2 posts views Thread by Vilmar Braz„o de Oliveira | last post: by
5 posts views Thread by the other john | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.