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
%>
ASKER
' Here is the code for http://www.caf-fca.org/english/fileuploader/uploadform.htm
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="uploadexmple.asp">
<TABLE BORDER=0>
<tr><td><b>Enter your fullname:</b><br><INPUT TYPE=TEXT SIZE=40 NAME="FULLNAME"></td></tr>
<tr><td><b>Select a file to upload:</b><br><INPUT TYPE=FILE SIZE=50 NAME="FILE1"></td></tr>
<tr><td><b>Save To:</b>
Disk <INPUT TYPE=RADIO NAME="saveto" value="disk" checked>
Database <INPUT TYPE=RADIO NAME="saveto" value="database">
</td></tr>
<tr><td align="center"><INPUT TYPE=SUBMIT VALUE="Upload!"></td></tr>
</TABLE>
</FORM>
</BODY>
</HTML>
Then here is the code for: uploadexmple.asp
<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%
'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
' FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
' FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
' OR LATER.
' Create the FileUploader
Dim Uploader, File
Set Uploader = New FileUploader
Dim strUploadPath, strFilePath
Dim strEmail, strName, strComments, objMail
strUploadPath = "[UploadedFiles]"
' This starts the upload process
Uploader.Upload()
'******************************************
' Use [FileUploader object].Form to access
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
Response.Write "<b>Thank you for your upload " & Uploader.Form("fullname") & "</b><br>"
' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items
' Check where the user wants to save the file
' If Uploader.Form("saveto") = "disk" Then
' Save the file
'File.SaveToDisk "E:\UploadedFiles\"
File.SaveToDisk strUploadPath
' ElseIf Uploader.Form("saveto") = "database" Then
' Open the table you are saving the file to
' Set RS = Server.CreateObject("ADODB.Recordset")
' RS.Open "MyUploadTable", "CONNECT STRING OR ADO.Connection", 2, 2
' RS.AddNew ' create a new record
' RS("filename") = File.FileName
' RS("filesize") = File.FileSize
' RS("contenttype") = File.ContentType
' Save the file to the database
' File.SaveToDatabase RS("filedata")
' Commit the changes and close
' RS.Update
' RS.Close
' End If
strFilePath = strUploadPath & File.FileName
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@caf-fca.org"
objMail.Subject = "Reports Survey - Online Transaction "
objMail.To = "elie_azzi@caf-fca.org"
objMail.cc = "elie_azzi@caf-fca.org"
objMail.Body = "Test Email"
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.Importance = 2
objMail.AttachFile(strFilePath)
objMail.Send
Set objMail = nothing
' Output the file details to the browser
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
Next
End If
%>
strUploadPath = "D:\Inetpub\www\www.caf-fca.org\english\UploadedFiles"
strUploadPath = "D:\Inetpub\www\www.caf-fca.org\english\UploadedFiles\"
ASKER
' Here is the code. http://www.caf-fca.org/english/order.asp
....
<tr><td colspan="2"><LABEL class=preField id=mi-L for=mi style="width:600px;" for=category>
<strong>Please provide a copy of the article with this report</strong></label></td></tr>
<TR>
<TD><LABEL class=preField id=mi-L for=mi style="width:150px;" for=category>Enter the article name:</label>
<INPUT TYPE=TEXT SIZE=30 NAME="FULLNAME">
</TD>
<TD><LABEL class=preField id=mi-L for=mi style="width:150px;" for=category>Select a file to upload:</label>
<INPUT TYPE=FILE SIZE=30 NAME="FILE1"></TD>
</TR>
......
And here is the code for the other page":
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="../dp12orangew3c.css" rel="stylesheet" type="text/css">
<link href="../style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=665, height=600, left=100, top=25";
var content_vlue = document.getElementById("print_content").innerHTML;
var docprint=window.open("","",disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>CAF-FCA - Documents and reports</title>');
docprint.document.write('</head><body onLoad="self.print()"><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.document.close();
docprint.focus();
}
</script>
</HEAD><BODY BGCOLOR=#ffffff LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH="0" MARGINHEIGHT="0">
<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%
Dim Uploader, File
Set Uploader = New FileUploader
Dim strUploadPath, strFilePath
DIM strEmail, strName, strComments, objMail
strUploadPath = "D:\Inetpub\www\www.caf-fca.org\english\UploadedFiles\"
' This starts the upload process
Uploader.Upload()
Response.Write "<b>Thank you for your upload " & Uploader.Form("fullname") & "</b><br>"
' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items
' Check where the user wants to save the file
' If Uploader.Form("saveto") = "disk" Then
' Save the file
'File.SaveToDisk "E:\UploadedFiles\"
File.SaveToDisk strUploadPath
' ElseIf Uploader.Form("saveto") = "database" Then
' Open the table you are saving the file to
' Set RS = Server.CreateObject("ADODB.Recordset")
' RS.Open "MyUploadTable", "CONNECT STRING OR ADO.Connection", 2, 2
' RS.AddNew ' create a new record
' RS("filename") = File.FileName
' RS("filesize") = File.FileSize
' RS("contenttype") = File.ContentType
' Save the file to the database
' File.SaveToDatabase RS("filedata")
' Commit the changes and close
' RS.Update
' RS.Close
' End If
strFilePath = strUploadPath & File.FileName
strName = Request.Form("TxtFName")
strComments = Request.Form("TxtTitle")
strFilePath = strUploadPath & File.FileName
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.AttachFile(strFilePath)
objMail.Send
Set objMail = nothing
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
Next
End If
%>
ASKER
Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.
TRUSTED BY
ASKER
The crazed,
Thank you but i'm not an expert in ASP. would you please give me the code to put it on my form.
thx.