I am trying to send an CDO email after pure ASP file upload.

However I am getting an error:

Thank you for your upload
File(s) not uploaded.
Microsoft VBScript runtime error '800a01a8'

Object required: 'Form(...)'

/chemicalmgmt/uploadexmple.asp, line 67


Here is the following ASP codes that I am using (I identified line 67
with ERROR):

<%@ 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

' 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
"D:\WWWApplications\htdoc\ftp\users\fp\chemicalmgmt\TestUpload"

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

' 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

ERROR If Uploader.Form("Submit").Count > 0 Then

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject ="Test Page - File upload"
objMessage.Sender = "" & Request.Form("email1") & ""
objMessage.To ="jason.p.kesselring@lmco.com"
objMessage.AttachFile Server.MapPath("TestUpload/" & File.FileName)
objMessage.TextBody = _
"Email: " & request("email1") & vbCrLf & _
"Confirmation #: " & request("ConfirmID") & vbCrLf & _
"Name: " & request("fullname") & vbCrLf
objMessage.Send
End If

%>

Re: ASP - send email after pure ASP upload by p

p
Tue Aug 29 19:07:07 CDT 2006

Beefminator wrote:
> I am trying to send an CDO email after pure ASP file upload.
>
> However I am getting an error:
>
> Thank you for your upload
> File(s) not uploaded.
> Microsoft VBScript runtime error '800a01a8'
>
> Object required: 'Form(...)'
>
> /chemicalmgmt/uploadexmple.asp, line 67
>
>
> Here is the following ASP codes that I am using (I identified line 67
> with ERROR):
>
> <%@ 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
>
> ' 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
> "D:\WWWApplications\htdoc\ftp\users\fp\chemicalmgmt\TestUpload"
>
> 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
>
> ' 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
>
> ERROR If Uploader.Form("Submit").Count > 0 Then
>
> Set objMessage = CreateObject("CDO.Message")
> objMessage.Subject ="Test Page - File upload"
> objMessage.Sender = "" & Request.Form("email1") & ""
> objMessage.To ="jason.p.kesselring@lmco.com"
> objMessage.AttachFile Server.MapPath("TestUpload/" & File.FileName)
> objMessage.TextBody = _
> "Email: " & request("email1") & vbCrLf & _
> "Confirmation #: " & request("ConfirmID") & vbCrLf & _
> "Name: " & request("fullname") & vbCrLf
> objMessage.Send
> End If
>
> %>
>

Re: ASP - send email after pure ASP upload by p

p
Tue Aug 29 19:08:25 CDT 2006

Beefminator wrote:
> I am trying to send an CDO email after pure ASP file upload.
>
> However I am getting an error:
>
> Thank you for your upload
> File(s) not uploaded.
> Microsoft VBScript runtime error '800a01a8'
>
> Object required: 'Form(...)'
>
> /chemicalmgmt/uploadexmple.asp, line 67

Which line is line 67? It sounds lie the file upload failed.

Re: ASP - send email after pure ASP upload by Beefminator

Beefminator
Wed Aug 30 05:53:25 CDT 2006

Line 67 is the following:

If Uploader.Form("Submit").Count > 0 Then


Re: ASP - send email after pure ASP upload by Beefminator

Beefminator
Thu Aug 31 13:10:02 CDT 2006

I went ahead and create another asp perform to perform the CDO email
asp.

Form web page ----> ASP web page (Pure ASP upload) ---> ASP web page
(ASP CDO)

Seems to work for whatever reason.