Advertisement

07.17.2008 at 08:46AM PDT, ID: 23573664 | Points: 500
[x]
Attachment Details

Upload a file in ASP

Asked by elieazzi in Active Server Pages (ASP)

Tags:

Hello,

I want know, what is the code i should put it in my page to be able to receive the file in my email. pls advice.

This is the form:
http://www.caf-fca.org/english/order.asp

This is the code on this page:

         <form name="YourFormName" method="Post" action="orderconf.asp" onSubmit="return checkForm(this);">
.....          
  <TR>
            <TD colSpan=2>Do you have any file to upload: Optional Upload File<br>
      <input type="file" name="opt_file[0]" value="" size="35" /></td>
      </TD></TR>
.....

Pls advice.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
And on the form orderconf.asp 
 
I add this line to have the file.
 
<%
DIM strEmail, strName, strComments, objMail
strName = Request.Form("TxtFName")
strComments = Request.Form("TxtTitle")
 
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@caf-fca.org"
objMail.Subject = "Reports Survey - Online Transaction " & Request.Form("TxtFName") 
objMail.To = "elie_azzi@caf-fca.org"
objMail.cc = "elie_azzi@caf-fca.org"
objMail.Body = "Email: " & strEmail & vbCrLf & _
"Name: " & strName & vbCrLf & _
"Title: " & vbCrLf & strComments
objMail.BodyFormat=0   
objMail.MailFormat=0
objMail.Importance = 2
 
objMail.body="<html>" & VBCrLF & "<Title></Title>" & VBCrLf & "<Head></Head>" & VBCrLf & "<Body>" & vbCrLf & _ 
"<h3><center><font color=red>Making it work! - Online Order</font></center></h3>" & VBCrLf & _
"<p><strong>Date Submitted:</strong> " & Now() & VBCrLf & VBCrLf & _
"<h3><font color=Blue>Billing Address:</font></h3>" & VBCrLf & _
"<p><strong>Name:</strong> " & Request.Form("salutation") & "  " & Request.Form("TxtFName") & "  " & Request.Form("TxtMName") & "  " & Request.Form("TxtLName")& VBCrLf & VBCrLf & _
"<h4><font color=red>Quantity and Description</font></h4>" & VBCrLf & _
"<p><strong>Title:</strong> " & Request.Form("txtTitle") & VBCrLf & VBCrLf & _
"<p><strong>Department:</strong> " & Request.Form("TxtDepartment") & VBCrLf & VBCrLf & _
"<p><strong>Organization:</strong> " & Request.Form("TxtOrganization") & VBCrLf & VBCrLf & _
"<p><strong>Address:</strong> " & Request.Form("TxtAddress") & VBCrLf & VBCrLf & _
"<p><strong>City:</strong> " & Request.Form("TxtCity") & VBCrLf & VBCrLf & _
"<p><strong>Email:</strong> " & Request.Form("email") & VBCrLf & VBCrLf & _
"<p><strong>Province:</strong> " & Request.Form("Province") & VBCrLf & VBCrLf & _
"<p><strong>File:</strong> " & Request.Form("file") & VBCrLf & VBCrLf & _
"<p><strong>Postal Code:</strong> " & Request.Form("txtPostalCode1") & " - " & Request.Form("txtPostalCode2") & VBCrLf & VBCrLf & _
"<p><strong>Telephone:</strong> " & "(" & Request.Form("phone1") & ") " & Request.Form("phone2") & "-" & Request.Form("phone3") & " Ext. " & Request.Form("phone4") &VBCrLf & VBCrLf & _
"<p><strong>Fax:</strong> " & "(" & Request.Form("fax1") & ") " & Request.Form("fax2") & "-" & Request.Form("fax3") &VBCrLf & VBCrLf & _
"<p><strong>Name of report / resource:</strong> Apprenticeship Labour Market Outcomes in Canada since 2000 " & VBCrLf & VBCrLf & _
"<p><strong>User Category:</strong> " & Request.Form("UserCategory") & VBCrLf & VBCrLf & _
"<p><strong>The purpose for downloading the information:</strong> " & Request.Form("purpose") & VBCrLf & VBCrLf & _
"<p><strong>Any more information and/or to receive our newsletters and other communications:</strong> " & Request.Form("specialreq") & VBCrLf & VBCrLf & _
"<p><strong>Please provide your email address:</strong> " & Request.Form("NewslettersEmail") & VBCrLf & VBCrLf & _
"</body>" & VBCrLf & "</html>"
objMail.Send
Set objMail = nothing
%>
[+][-]07.17.2008 at 09:57AM PDT, ID: 22027442

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 10:12AM PDT, ID: 22027616

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 03:06AM PDT, ID: 22049132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 08:03AM PDT, ID: 22051153

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 08:13AM PDT, ID: 22051251

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 08:14AM PDT, ID: 22051267

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 11:35AM PDT, ID: 22053135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 01:44AM PDT, ID: 22057291

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628