Forum Moderators: open

Message Too Old, No Replies

Microsoft VBScript runtime error '800a01a8'

         

SBee

3:35 am on Oct 27, 2005 (gmt 0)

10+ Year Member



Hi-

I am having so many problems with this script. It emails information from a form to an email address. Everything worked like a charm until i had to add the ability to upload an image.
I am using the code that my webhost requires SoftArtisans.FileUp - and now i have obviously done something wrong.

Here is the error:

Microsoft VBScript runtime error '800a01a8'

Object required: 'Upload'

/be_friends_form2.asp, line 62

-------------------

The form code is here: www.thinkfeelbe.com/be_friends_form2.html

-------------------

Here is the code:

<%
' ----------------------------------------------------
' -----
' ----- Forms To Go v2.6.9 by Bebosoft, Inc.
' -----
' ----- [bebosoft.com...]
' -----
' ----------------------------------------------------

'----------
' Filter Control Characters

Function filterCchar(TextToFilter)

Dim regEx

Set regEx = New RegExp

regEx.Global = true
regEx.IgnoreCase = true
regEx.Pattern ="[\x00-\x1F]"

filterCchar = regEx.Replace(TextToFilter, "")

End Function
Dim ClientIP

if Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" then
ClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
else
ClientIP = Request.ServerVariables("REMOTE_ADDR")
end if

Dim objCDOSYSMail
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Dim objCDOSYSCnfg
Set objCDOSYSCnfg = Server.CreateObject("CDO.Configuration")

Dim oFileUp

'--- Instantiate the FileUp object
Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")

'--- Set the Path property to the location you wish to temporarily cache the incoming file before saving
oFileUp.Path = Server.MapPath("uploads")

'--- Check if a file was selected (myFile is coming from the html code)
'--- If so, continue processing
If Not oFileUp.Form("attachedfile").IsEmpty Then

'--- Save the file
oFileUp.Form("attachedfile").Save

Else
Response.Write("Error: There was no file submitted for upload.")
End If

'--- Destroy objects
Set oFileUp = Nothing
FTGname = Upload.Form("name")
FTGage = Upload.Form("age")
FTGcity = Upload.Form("city")
FTGstate = Upload.Form("state")
FTGemail = Upload.Form("email")
FTGoccupation = Upload.Form("occupation")
FTGHow_stay_fit = Upload.Form("How_stay_fit")
FTGwhat_motivates_you = Upload.Form("what_motivates_you")
FTGpassions_hobbies = Upload.Form("passions_hobbies")

If Not fileUpload_attachedfile Is Nothing Then
FTGattachedfile = fileUpload_attachedfile.Path
Else
FTGattachedfile = ""
End If
FTGfull_name = Upload.Form("full_name")
FTGmail_address = Upload.Form("mail_address")
FTGcity_mail = Upload.Form("city_mail")
FTGstate_mail = Upload.Form("state_mail")
FTGzip_mail = Upload.Form("zip_mail")
FTGphone = Upload.Form("phone")
FTGsubmit = Upload.Form("submit")

' Redirect user to the error page

If (validationFailed = true) Then

Response.Redirect "error.html"
Response.End

End If

' Owner Email: cdosys

objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.1and1.com"
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCnfg.Fields.Update

objCDOSYSMail.Configuration = objCDOSYSCnfg
emailFrom = FilterCchar(FTGemail)
emailSubject = FilterCchar("Be Friends Form")
emailBodyText = "Name: " & FTGname & "" & vbCrLf _
& "" & vbCrLf _
& "Age: " & FTGage & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate & "" & vbCrLf _
& "" & vbCrLf _
& "Email Address: " & FTGemail & "" & vbCrLf _
& "" & vbCrLf _
& "Occupation: " & FTGoccupation & "" & vbCrLf _
& "" & vbCrLf _
& "How do you stay fit?: " & FTGHow_stay_fit & "" & vbCrLf _
& "" & vbCrLf _
& "What motivates you?: " & FTGwhat_motivates_you & "" & vbCrLf _
& "" & vbCrLf _
& "What are your passions and hobbies?: " & FTGpassions_hobbies & "" & vbCrLf _
& "" & vbCrLf _
& "attachedfile: " & FTGattachedfile & "" & vbCrLf _
& "" & vbCrLf _
& "Full Name: " & FTGfull_name & "" & vbCrLf _
& "" & vbCrLf _
& "Mailing Address: " & FTGmail_address & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity_mail & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Zip Code: " & FTGzip_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Phone: " & FTGphone & "" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& ""

objCDOSYSMail.To = "shawnbee@charter.net, robin@thinkfeelbe.com"
objCDOSYSMail.From = emailFrom
objCDOSYSMail.Subject = emailSubject
objCDOSYSMail.TextBody = emailBodyText
objCDOSYSMail.BodyPart.Charset = "ISO-8859-1"

If Not fileUpload_attachedfile Is Nothing Then

objCDOSYSMail.AddAttachment fileUpload_attachedfile.path

End If

objCDOSYSMail.Send

' Redirect user to success page

Response.Redirect "thankyou.html"

' End of ASP script
%>

mattglet

11:32 am on Oct 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change all your "Upload" references to "oFileUp", and you should be fine.

Also, be sure to move your Set oFileUp = Nothing AFTER your oFileUp.Form stuff.

SBee

2:57 pm on Oct 27, 2005 (gmt 0)

10+ Year Member



Hi-

Thank you for even looking at this for me. I made the changes and now when i hit submit on my formm, i get the familiar HTTP 500 - Internal server error
Internet Explorer error.

Here is what i did:

<%
' ----------------------------------------------------
' -----
' ----- Forms To Go v2.6.9 by Bebosoft, Inc.
' -----
' ----- [bebosoft.com...]
' -----
' ----------------------------------------------------

'----------
' Filter Control Characters

Function filterCchar(TextToFilter)

Dim regEx

Set regEx = New RegExp

regEx.Global = true
regEx.IgnoreCase = true
regEx.Pattern ="[\x00-\x1F]"

filterCchar = regEx.Replace(TextToFilter, "")

End Function
Dim ClientIP

if Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" then
ClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
else
ClientIP = Request.ServerVariables("REMOTE_ADDR")
end if

Dim objCDOSYSMail
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Dim objCDOSYSCnfg
Set objCDOSYSCnfg = Server.CreateObject("CDO.Configuration")

Dim oFileUp

'--- Instantiate the FileUp object
Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")

'--- Set the Path property to the location you wish to temporarily cache the incoming file before saving
oFileUp.Path = Server.MapPath("uploads")

'--- Check if a file was selected (myFile is coming from the html code)
'--- If so, continue processing
If Not oFileUp.Form("attachedfile").IsEmpty Then

'--- Save the file
oFileUp.Form("attachedfile").Save

'--- The file is saved, display a confirmation message
Response.Write ("<B>File saved successfully on the server as:</B><BR>")

'--- The ServerName() property is the full path of the file where it was saved on the server
Response.Write(oFileUp.Form("attachedfile").ServerName)

Else
Response.Write("Error: There was no file submitted for upload.")
End If

'--- Destroy objects
Set oFileUp = Nothing
FTGname = oFileUp.Form("name")
FTGage = oFileUp.Form("age")
FTGcity = oFileUp.Form("city")
FTGstate = oFileUp.Form("state")
FTGemail = oFileUp.Form("email")
FTGoccupation = oFileUp.Form("occupation")
FTGHow_stay_fit = oFileUp.Form("How_stay_fit")
FTGwhat_motivates_you = oFileUp.Form("what_motivates_you")
FTGpassions_hobbies = oFileUp.Form("passions_hobbies")

If Not fileoFileUp_attachedfile Is Nothing Then
FTGattachedfile = fileoFileUp_attachedfile.Path
Else
FTGattachedfile = ""
End If
FTGfull_name = oFileUp.Form("full_name")
FTGmail_address = oFileUp.Form("mail_address")
FTGcity_mail = oFileUp.Form("city_mail")
FTGstate_mail = oFileUp.Form("state_mail")
FTGzip_mail = oFileUp.Form("zip_mail")
FTGphone = oFileUp.Form("phone")
FTGsubmit = oFileUp.Form("submit")

' Redirect user to the error page

If (validationFailed = true) Then

Response.Redirect "error.html"
Response.End

End If

' Owner Email: cdosys

objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.1and1.com"
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCnfg.Fields.Update

objCDOSYSMail.Configuration = objCDOSYSCnfg
emailFrom = FilterCchar(FTGemail)
emailSubject = FilterCchar("Be Friends Form")
emailBodyText = "Name: " & FTGname & "" & vbCrLf _
& "" & vbCrLf _
& "Age: " & FTGage & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate & "" & vbCrLf _
& "" & vbCrLf _
& "Email Address: " & FTGemail & "" & vbCrLf _
& "" & vbCrLf _
& "Occupation: " & FTGoccupation & "" & vbCrLf _
& "" & vbCrLf _
& "How do you stay fit?: " & FTGHow_stay_fit & "" & vbCrLf _
& "" & vbCrLf _
& "What motivates you?: " & FTGwhat_motivates_you & "" & vbCrLf _
& "" & vbCrLf _
& "What are your passions and hobbies?: " & FTGpassions_hobbies & "" & vbCrLf _
& "" & vbCrLf _
& "attachedfile: " & FTGattachedfile & "" & vbCrLf _
& "" & vbCrLf _
& "Full Name: " & FTGfull_name & "" & vbCrLf _
& "" & vbCrLf _
& "Mailing Address: " & FTGmail_address & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity_mail & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Zip Code: " & FTGzip_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Phone: " & FTGphone & "" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& ""

objCDOSYSMail.To = "shawnbee@charter.net, robin@thinkfeelbe.com"
objCDOSYSMail.From = emailFrom
objCDOSYSMail.Subject = emailSubject
objCDOSYSMail.TextBody = emailBodyText
objCDOSYSMail.BodyPart.Charset = "ISO-8859-1"

If Not fileoFileUp_attachedfile Is Nothing Then

objCDOSYSMail.AddAttachment fileoFileUp_attachedfile.path

End If

objCDOSYSMail.Send

' Redirect user to success page

Response.Redirect "thankyou.html"

' End of ASP script
%>

-----------------

i am new to this, and understanding only the very basics - but this one has me very confused.

Shawna

mattglet

4:30 pm on Oct 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In IE, click on Tools --> Internet Options --> Advanced tab --> Uncheck "Show Friendly HTTP Error Messages".

Re-run your page, and paste the correct error message.

Also:


'--- Destroy objects
Set oFileUp = Nothing
FTGname = oFileUp.Form("name")

You need to move "Set oFileUp = Nothing" down below all your variable creations. Since you are setting oFileUp = nothing, any oFileUp.Form call will not work.

SBee

6:57 pm on Oct 27, 2005 (gmt 0)

10+ Year Member



new error:
File saved successfully on the server as:
E:\kunden\homepages\22\d110809290\uploads\autumn1.gif
Microsoft VBScript runtime error '800a01a8'

Object required

/be_friends_form2.asp, line 77

---------

Here is my latest code - when this all works successfully, i really want the thankyou.html page to load - not this text "File saved successfully..."
thank you in advance, you have already helped me so much-
Shawna

<%
' ----------------------------------------------------
' -----
' ----- Forms To Go v2.6.9 by Bebosoft, Inc.
' -----
' ----- [bebosoft.com...]
' -----
' ----------------------------------------------------

'----------
' Filter Control Characters

Function filterCchar(TextToFilter)

Dim regEx

Set regEx = New RegExp

regEx.Global = true
regEx.IgnoreCase = true
regEx.Pattern ="[\x00-\x1F]"

filterCchar = regEx.Replace(TextToFilter, "")

End Function
Dim ClientIP

if Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" then
ClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
else
ClientIP = Request.ServerVariables("REMOTE_ADDR")
end if

Dim objCDOSYSMail
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Dim objCDOSYSCnfg
Set objCDOSYSCnfg = Server.CreateObject("CDO.Configuration")

Dim oFileUp

'--- Instantiate the FileUp object
Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")

'--- Set the Path property to the location you wish to temporarily cache the incoming file before saving
oFileUp.Path = Server.MapPath("uploads")

'--- Check if a file was selected (myFile is coming from the html code)
'--- If so, continue processing
If Not oFileUp.Form("attachedfile").IsEmpty Then

'--- Save the file
oFileUp.Form("attachedfile").Save

'--- The file is saved, display a confirmation message
Response.Write ("<B>File saved successfully on the server as:</B><BR>")

'--- The ServerName() property is the full path of the file where it was saved on the server
Response.Write(oFileUp.Form("attachedfile").ServerName)

Else
Response.Write("Error: There was no file submitted for upload.")
End If

'--- Destroy objects
FTGname = oFileUp.Form("name")
FTGage = oFileUp.Form("age")
FTGcity = oFileUp.Form("city")
FTGstate = oFileUp.Form("state")
FTGemail = oFileUp.Form("email")
FTGoccupation = oFileUp.Form("occupation")
FTGHow_stay_fit = oFileUp.Form("How_stay_fit")
FTGwhat_motivates_you = oFileUp.Form("what_motivates_you")
FTGpassions_hobbies = oFileUp.Form("passions_hobbies")

If Not fileoFileUp_attachedfile Is Nothing Then
FTGattachedfile = fileoFileUp_attachedfile.Path
Else
FTGattachedfile = ""
End If
FTGfull_name = oFileUp.Form("full_name")
FTGmail_address = oFileUp.Form("mail_address")
FTGcity_mail = oFileUp.Form("city_mail")
FTGstate_mail = oFileUp.Form("state_mail")
FTGzip_mail = oFileUp.Form("zip_mail")
FTGphone = oFileUp.Form("phone")
FTGsubmit = oFileUp.Form("submit")

' Redirect user to the error page

If (validationFailed = true) Then

Response.Redirect "error.html"
Response.End

End If

' Owner Email: cdosys

objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.1and1.com"
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCnfg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCnfg.Fields.Update

objCDOSYSMail.Configuration = objCDOSYSCnfg
emailFrom = FilterCchar(FTGemail)
emailSubject = FilterCchar("Be Friends Form")
emailBodyText = "Name: " & FTGname & "" & vbCrLf _
& "" & vbCrLf _
& "Age: " & FTGage & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate & "" & vbCrLf _
& "" & vbCrLf _
& "Email Address: " & FTGemail & "" & vbCrLf _
& "" & vbCrLf _
& "Occupation: " & FTGoccupation & "" & vbCrLf _
& "" & vbCrLf _
& "How do you stay fit?: " & FTGHow_stay_fit & "" & vbCrLf _
& "" & vbCrLf _
& "What motivates you?: " & FTGwhat_motivates_you & "" & vbCrLf _
& "" & vbCrLf _
& "What are your passions and hobbies?: " & FTGpassions_hobbies & "" & vbCrLf _
& "" & vbCrLf _
& "attachedfile: " & FTGattachedfile & "" & vbCrLf _
& "" & vbCrLf _
& "Full Name: " & FTGfull_name & "" & vbCrLf _
& "" & vbCrLf _
& "Mailing Address: " & FTGmail_address & "" & vbCrLf _
& "" & vbCrLf _
& "City: " & FTGcity_mail & "" & vbCrLf _
& "" & vbCrLf _
& "State: " & FTGstate_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Zip Code: " & FTGzip_mail & "" & vbCrLf _
& "" & vbCrLf _
& "Phone: " & FTGphone & "" & vbCrLf _
& "" & vbCrLf _
& "" & vbCrLf _
& ""

objCDOSYSMail.To = "shawnbee@charter.net, robin@thinkfeelbe.com"
objCDOSYSMail.From = emailFrom
objCDOSYSMail.Subject = emailSubject
objCDOSYSMail.TextBody = emailBodyText
objCDOSYSMail.BodyPart.Charset = "ISO-8859-1"

Set oFileUp = Nothing

If Not fileoFileUp_attachedfile Is Nothing Then

objCDOSYSMail.AddAttachment fileoFileUp_attachedfile.path

End If

objCDOSYSMail.Send

' Redirect user to success page

Response.Redirect "thankyou.html"

' End of ASP script
%>