Forums
This topic is locked
multipart/form-data AND Request.Form
Posted 10 Mar 2003 11:06:09
1
has voted
10 Mar 2003 11:06:09 Paul Butler posted:
HiWhen I use the Pure ASP Upload 2.0 the form data is sent using multipart/form-data. This all works fine. However I want to send an email alerting me to the fact that someone has uploaded their details. I know how to get this to work using Request.Form("email" etc but this no longer works with multipart/form-data. So does anyone know what an alternative method to Request.Form might be under these circumstances. Basically I want to get the users email address out of the form that they have submitted?
Thanks in advance.
Paulb
Replies
Replied 10 Mar 2003 22:41:43
10 Mar 2003 22:41:43 Sean Riley replied:
I think you are looking for the values that get transferred to a new object UploadQueryString("xyz" or UploadFormRequest("xyz"
Replied 11 Mar 2003 18:05:32
11 Mar 2003 18:05:32 Paul Butler replied:
Thanks dogriley
What I'm actually trying to do is hack an existing script which use CDO Form Mail. So instead of using Request.Form exchange that for UploadFormRequest or UploadQueryString. I've tried do a straight swap for request.form for UploadFormRequest but my page breaks. Any ideas. I've included the code I'm using below...
'Code starts here
<%
Const Header = "Client Web form submission"
Const Footer = "end of submission"
' read all the form elements and place them in the variable mail_body
Dim mail_Body
mail_Body = Header & vbCrLf & vbCrLf
mail_Body = mail_Body & Request.Form("forename" & " " & Request.Form("surname" & " submitted the following" & vbCrLf & vbCrLf
mail_Body = mail_Body & "FORM submitted at " & Now() & vbCrLf & vbCrLf
If Request.Form("add" <> "" Then 'Need to sort output
Dim arrSortOrder
arrSortOrder = Split(Request.Form("add","|"
For each FormElement in arrSortOrder
mail_body = mail_body & FormElement & ": " & Request.Form(FormElement) & vbCrLf
Next
Else 'No sorting required
Dim form_element
For Each FormElement in Request.Form
mail_body = mail_body & FormElement & ": " & Request.Form(FormElement) & vbCrLf
Next
End If
mail_Body = mail_Body & vbCrLf & Footer
'Create the mail object and send the mail
Set objMail = CreateObject("CDONTS.NewMail"
objMail.From = Request.Form("email"
objMail.To = " "
objMail.CC = Request.Form("email"
objMail.BCC = ""
objMail.Subject = "Client form submission"
objMail.Body = mail_Body
objMail.Send()
Set objMail = Nothing
'Send them to the page specified if requested
Dim rp_redirect
rp_redirect = ""
If (rp_redirect <> "" then
Response.Redirect rp_redirect
End If
%>
'Code ends
What I'm actually trying to do is hack an existing script which use CDO Form Mail. So instead of using Request.Form exchange that for UploadFormRequest or UploadQueryString. I've tried do a straight swap for request.form for UploadFormRequest but my page breaks. Any ideas. I've included the code I'm using below...
'Code starts here
<%
Const Header = "Client Web form submission"
Const Footer = "end of submission"
' read all the form elements and place them in the variable mail_body
Dim mail_Body
mail_Body = Header & vbCrLf & vbCrLf
mail_Body = mail_Body & Request.Form("forename" & " " & Request.Form("surname" & " submitted the following" & vbCrLf & vbCrLf
mail_Body = mail_Body & "FORM submitted at " & Now() & vbCrLf & vbCrLf
If Request.Form("add" <> "" Then 'Need to sort output
Dim arrSortOrder
arrSortOrder = Split(Request.Form("add","|"
For each FormElement in arrSortOrder
mail_body = mail_body & FormElement & ": " & Request.Form(FormElement) & vbCrLf
Next
Else 'No sorting required
Dim form_element
For Each FormElement in Request.Form
mail_body = mail_body & FormElement & ": " & Request.Form(FormElement) & vbCrLf
Next
End If
mail_Body = mail_Body & vbCrLf & Footer
'Create the mail object and send the mail
Set objMail = CreateObject("CDONTS.NewMail"
objMail.From = Request.Form("email"
objMail.To = " "
objMail.CC = Request.Form("email"
objMail.BCC = ""
objMail.Subject = "Client form submission"
objMail.Body = mail_Body
objMail.Send()
Set objMail = Nothing
'Send them to the page specified if requested
Dim rp_redirect
rp_redirect = ""
If (rp_redirect <> "" then
Response.Redirect rp_redirect
End If
%>
'Code ends