Gemini532
asked on
Server.CreateObject Failed
I have 2 files .asp files, one called browse.asp and one called uploadBrowse.asp to browse and upload files. But I'm getting an error in the "uploadBrowse.asp" file.
THIS IS THE ERROR: (IT COMES FROM THE "uploadBrowse.asp" FILE
AND FROM THIS LINE OF CODE: Set Upload = Server.CreateObject("Persi ts.Upload" ))
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/angie/uploadBrowse.asp, line 4
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
This is the code for the "browse.asp" file:
<HTML>
<BODY BGCOLOR="#FFFFFF">
<FORM METHOD="POST" ENCTYPE="multipart/form-da ta" ACTION="uploadBrowse.asp">
File 1:<INPUT TYPE=FILE NAME="FILE1">
Description 1:<INPUT TYPE=TEXT NAME="DESCR1"><BR>
File 2:<INPUT TYPE=FILE NAME="FILE2">
Description 2:<INPUT TYPE=TEXT NAME="DESCR2"><BR>
<INPUT TYPE=SUBMIT VALUE="Upload!">
</FORM>
</BODY>
</HTML>
This is the code for the "uploadBrowse.asp" file:
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persi ts.Upload" )
Count = Upload.Save("c:\upload")
Response.Write Count & " file(s) uploaded to c:\upload"
%>
</BODY>
</HTML>
Can you help me?
THIS IS THE ERROR: (IT COMES FROM THE "uploadBrowse.asp" FILE
AND FROM THIS LINE OF CODE: Set Upload = Server.CreateObject("Persi
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/angie/uploadBrowse.asp, line 4
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
This is the code for the "browse.asp" file:
<HTML>
<BODY BGCOLOR="#FFFFFF">
<FORM METHOD="POST" ENCTYPE="multipart/form-da
File 1:<INPUT TYPE=FILE NAME="FILE1">
Description 1:<INPUT TYPE=TEXT NAME="DESCR1"><BR>
File 2:<INPUT TYPE=FILE NAME="FILE2">
Description 2:<INPUT TYPE=TEXT NAME="DESCR2"><BR>
<INPUT TYPE=SUBMIT VALUE="Upload!">
</FORM>
</BODY>
</HTML>
This is the code for the "uploadBrowse.asp" file:
<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persi
Count = Upload.Save("c:\upload")
Response.Write Count & " file(s) uploaded to c:\upload"
%>
</BODY>
</HTML>
Can you help me?
Sorry -- the DLL should be called "aspupload.dll"...
Thanks,
Phil
Thanks,
Phil
This is a link to a script I use to see if my host(s) support components:
http://www.pensaworks.com/prg_com.asp
basically you just download the script, and upload it to the server, then run the page. It will show you a huge list of components and whether or not they are installed. You can also filter by certain things like upload, email, etc...
The issue at hand is (without, knowing your host) that the ASPUpload component is not installed on your server. You should use the script from above and find out what Upload component(s) are installed, and then use code for one of them...
HTH
http://www.pensaworks.com/prg_com.asp
basically you just download the script, and upload it to the server, then run the page. It will show you a huge list of components and whether or not they are installed. You can also filter by certain things like upload, email, etc...
The issue at hand is (without, knowing your host) that the ASPUpload component is not installed on your server. You should use the script from above and find out what Upload component(s) are installed, and then use code for one of them...
HTH
ASKER
But what am I looking for? What needs to be installed?
aspupload.dll
Where on my computer or on the server which runs the website that I'm programming?
aspupload.dll
Where on my computer or on the server which runs the website that I'm programming?
ASKER
It seems that there's a 30 day free trial, this is something one has to buy?
But for hte people who would like to upload attachements to their email and have an application send them,w hat can they do if they dont have money?
Is there any way to do this for free?
But for hte people who would like to upload attachements to their email and have an application send them,w hat can they do if they dont have money?
Is there any way to do this for free?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow! I am very confused. I downloaded the files, but I have no idea how I should use them...
I mean their code is so strange... It might be too advanced for me...
Is this the simplest program there is?
I mean their code is so strange... It might be too advanced for me...
Is this the simplest program there is?
Are you using the PseudoRequestDictionary now, which is what this question is about?
https://www.experts-exchange.com/questions/21904538/Displaying-data-in-columns-and-rows.html
If so, you could have just posted the issue in this question... Since you've opened another question, and since you appear to be using one of the recommended items in that link, you should probably close this question.
Thanks,
Phil
https://www.experts-exchange.com/questions/21904538/Displaying-data-in-columns-and-rows.html
If so, you could have just posted the issue in this question... Since you've opened another question, and since you appear to be using one of the recommended items in that link, you should probably close this question.
Thanks,
Phil
Ah -- you and I posted about the same time! Okay -- so the code that is in the PseudoRequestObject isn't something that you should have to change. Using the code is really quite simple. I can help you with that if you like.
What are you trying to accomplish? I.e., do you want a form that allows users to upload 1 file from their PC to your server, and you also want to be able to write some fields to a DB?
Thanks,
Phil
What are you trying to accomplish? I.e., do you want a form that allows users to upload 1 file from their PC to your server, and you also want to be able to write some fields to a DB?
Thanks,
Phil
ASKER
Actually I want to add files as attachments to EMAILS.
I have the code where the user clicks and BROWSER button and adds the name of the file. Then he needs to click the SUBMIT button and the attachment gets attached to his email.... My email is using JMAIL, if you want I can include the code I have so far...
The only thing saved in the database is the NAME of the file, not the file itself, and I'm pretty sure that's just saving text with request.form("path")
I have the code where the user clicks and BROWSER button and adds the name of the file. Then he needs to click the SUBMIT button and the attachment gets attached to his email.... My email is using JMAIL, if you want I can include the code I have so far...
The only thing saved in the database is the NAME of the file, not the file itself, and I'm pretty sure that's just saving text with request.form("path")
ASKER
MY brother said that the attachments I'm sending to the emails have to first be saved in a folder on the server, is this true? He doesn't know that much about it...He can't help me code it...
please see here for attachments with JMail:
http://www.webmage.com/support/jmail.asp#AddAttachment
http://www.webmage.com/support/jmail.asp#AddAttachment
ASKER
I tried this code, but it didn't work EVEN THOUGH there a file by this name in my c: drive objMail.AttachFile("c:\ima ges\form.t xt")
<%
Option Explicit
Dim objMail
Set objMail = Server.CreateObject("CDONT S.NewMail" )
objMail.From = "friend@somewhere.com"
objMail.Subject = "A message TO you"
objMail.AttachFile("c:\ima ges\form.t xt")
objMail.To = "someone@someplace.com"
objMail.Body = "This is the body of the Message"
objMail.Send
Response.write("Mail was Sent")
'You must always do this with CDONTS.
set objMail = nothing
%>
<%
Option Explicit
Dim objMail
Set objMail = Server.CreateObject("CDONT
objMail.From = "friend@somewhere.com"
objMail.Subject = "A message TO you"
objMail.AttachFile("c:\ima
objMail.To = "someone@someplace.com"
objMail.Body = "This is the body of the Message"
objMail.Send
Response.write("Mail was Sent")
'You must always do this with CDONTS.
set objMail = nothing
%>
ASKER
I get this error:
error '80004005'
Unspecified error
/investment/ProposalsRecei ved.asp, line 137
From this line: objMail.AttachFile("c:\ima ges\form.t xt")
error '80004005'
Unspecified error
/investment/ProposalsRecei
From this line: objMail.AttachFile("c:\ima
ok....now you are confusing everyone here.....first you said it was an upload problem, then you said it's a JMail problem, but then you go and post code for CDONTS.
Please, before you go any further, make up my mind, and tell me what the problem is.
Please, before you go any further, make up my mind, and tell me what the problem is.
ASKER
This isn't working either:
JMail.AddAttachment( "c:\\angie/form.txt" )
Is this javascript? I need VBScript...
JMail.AddAttachment( "c:\\angie/form.txt" )
Is this javascript? I need VBScript...
ASKER
OK I got it to work, but it ONLY WORKS WITH THIS VIRTUAL PATH (this is in JMail)
dim path
path = "/angie/readme.txt"
objMail.AddAttachment(Serv er.MapPath (path))
If I try to do this:
objMail.AddAttachment path, fileName
It no longer works, and I don't understand why!!!??!??
I mean after all I know the file exists there... why can't it attach it?
dim path
path = "/angie/readme.txt"
objMail.AddAttachment(Serv
If I try to do this:
objMail.AddAttachment path, fileName
It no longer works, and I don't understand why!!!??!??
I mean after all I know the file exists there... why can't it attach it?
ASKER
path = "c:/angie/readme.txt" <-- if it's real path
ASKER
theh problem is that the people who will upload the attachments to the form, will not use a virtual path.
They would get their files from their c drive or their desktop, so I need this to work
They would get their files from their c drive or their desktop, so I need this to work
ASKER
This is the error I get:
jmail.SMTPMail error '8000ffff
Cannot open file c:\temp\testdocument.doc email_process.asp, line 123
where line 123 is JMail.AddAttachment("c:\te mp\testdoc ument.doc" )
This is what the internet suggest, but I don't understand, because my users who fill out the form will not have virtual paths, so I cannot use this...
To find the location of the file on your webserver use the Server.MapPath command like this,
JMail.AddAttachment(Server .MapPath(" /temp/test document.d oc"))
jmail.SMTPMail error '8000ffff
Cannot open file c:\temp\testdocument.doc email_process.asp, line 123
where line 123 is JMail.AddAttachment("c:\te
This is what the internet suggest, but I don't understand, because my users who fill out the form will not have virtual paths, so I cannot use this...
To find the location of the file on your webserver use the Server.MapPath command like this,
JMail.AddAttachment(Server
ASKER
It says: The file must be local to the server.
ASKER
so to make this file local to the server, is that why I need to use the Persists.Upload object ?!?
ASKER
or the the PseudoRequestDictionar?
Is this what I need to use to th make the files local to the server and after that the users can attach them and the emails will be sent with their attachments? How do I do this?
Is this what I need to use to th make the files local to the server and after that the users can attach them and the emails will be sent with their attachments? How do I do this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm using JMail, I tried to use CDONTS, but it didn't work, so I'm using JMail now :)
I'm getting this error:
jmail.SMTPMail error '8000ffff'
Cannot open file c:\angie\form.txt
/investment/ProposalsRecei ved.asp, line 197
The folder angie has "write" permissions...
I'm getting this error:
jmail.SMTPMail error '8000ffff'
Cannot open file c:\angie\form.txt
/investment/ProposalsRecei
The folder angie has "write" permissions...
ok, please post your whole code for ProposalsReceived.asp
ASKER
<%
dim lName, fName, Comments, Attachment
dim DateSubmitted
dim strBody1
fName = Request.Form("FName")
lName = Request.Form("LName")
Comments = Request.Form("Comments")
DateSubmitted = Date()
Attachment = Request.Form("attach1")
'*********DATABASE CONNECTION************
dim objConn
Set objConn = Server.CreateObject("ADODB .Connectio n")
objConn.Open "fake","fake","fake"
requestSQL = "INSERT into [Proposals] (FirstName, LastName, Comments, AttachedFiles, DateSubmitted) values ('" & _
replace(fName, "'", "''") & "', '" & replace(lName, "'", "''") & "', '" & replace(Comments, "'", "''") & "', '" & replace(Attachment, "'", "''") & "', '" & replace(DateSubmitted, "'", "''") & "')"
objConn.Execute requestSQL
objConn.Close
Set objConn = Nothing
'***Re-open Connection to Start Email Code**********
dim conect, CommentsId
Set conect = Server.CreateObject("ADODB .Connectio n")
conect.Open "fake","fake","fake"
'On Error Resume Next
sqlError = "select * from [Proposals] where [Proposals].[FirstName] = ('" & replace(fName, "'", "''") & "') and [Proposals].[LastName] = ('" & replace(lName, "'", "''") & "') and [Proposals].[Comments] LIKE ('" & replace(Comments, "'", "''") & "') "
Set rsErrorCheck = Server.CreateObject("ADODB .Recordset ")
rsErrorCheck.Open sqlError, conect
'Long recordset counting using a simple loop by Barry Wright
Dim strCount
strCount = 0
While NOT rsErrorCheck.EOF AND NOT rsErrorCheck.BOF
strCount = strCount + 1
rsErrorCheck.MoveNext()
Wend
function sendEmail(body, Recipient1)
'JMAIL CODE ADDED 7-19-2001 BY MICHAEL LABMAN TO REPLACE CDONTS
set objMail=Server.CreateObjec t("Jmail.S MTPMail")
if Err.number <> 0 then
Response.Write("<BR>Error Sending Mail <BR>")
else
objMail.ServerAddress = "fake.fake.fake"
objMail.AddRecipient("blah @blah.blah ")
objMail.Sender = "fake@fake.fake"
objMail.Subject="Proposals Request"
‘objMail.AddAttachment( "C:\INETPUB\WWWROOT\angie\ form.txt" )
'objMail.AddAttachment(Ser ver.MapPat h(Attachme nt))
objMail.AddAttachment(Atta chment)
objMail.Body=body
objMail.Execute
end if
set objMail=nothing
end function
dim Recipient1
if strCount > 0 then
'********************
dim emailBody
dim strBody
strBody= "Name: " & fName & " " & lName
strBody=strBody & chr(10) & "Comments: " & Comments
strBody=strBody & chr(10) & "Date Submitted: " & DateSubmitted & vbCrLf
emailBody=strBody
sendEmail emailBody, Recipient1 'send email if the data was submitted correctly
else ' (RecordCount = -1 means that ADO could not find any records)
dim noDataEBody
noDataEBody = "The form you submitted did not reach the database. “
sendEmail noDataEBody, Recipient1 'call function, send email if the data did not make it to the database
end if
rsErrorCheck.close
set rsErrorCheck = nothing
conect.Close
Set conect = Nothing
%>
<center>Your proposal has been submitted!</center>
dim lName, fName, Comments, Attachment
dim DateSubmitted
dim strBody1
fName = Request.Form("FName")
lName = Request.Form("LName")
Comments = Request.Form("Comments")
DateSubmitted = Date()
Attachment = Request.Form("attach1")
'*********DATABASE CONNECTION************
dim objConn
Set objConn = Server.CreateObject("ADODB
objConn.Open "fake","fake","fake"
requestSQL = "INSERT into [Proposals] (FirstName, LastName, Comments, AttachedFiles, DateSubmitted) values ('" & _
replace(fName, "'", "''") & "', '" & replace(lName, "'", "''") & "', '" & replace(Comments, "'", "''") & "', '" & replace(Attachment, "'", "''") & "', '" & replace(DateSubmitted, "'", "''") & "')"
objConn.Execute requestSQL
objConn.Close
Set objConn = Nothing
'***Re-open Connection to Start Email Code**********
dim conect, CommentsId
Set conect = Server.CreateObject("ADODB
conect.Open "fake","fake","fake"
'On Error Resume Next
sqlError = "select * from [Proposals] where [Proposals].[FirstName] = ('" & replace(fName, "'", "''") & "') and [Proposals].[LastName] = ('" & replace(lName, "'", "''") & "') and [Proposals].[Comments] LIKE ('" & replace(Comments, "'", "''") & "') "
Set rsErrorCheck = Server.CreateObject("ADODB
rsErrorCheck.Open sqlError, conect
'Long recordset counting using a simple loop by Barry Wright
Dim strCount
strCount = 0
While NOT rsErrorCheck.EOF AND NOT rsErrorCheck.BOF
strCount = strCount + 1
rsErrorCheck.MoveNext()
Wend
function sendEmail(body, Recipient1)
'JMAIL CODE ADDED 7-19-2001 BY MICHAEL LABMAN TO REPLACE CDONTS
set objMail=Server.CreateObjec
if Err.number <> 0 then
Response.Write("<BR>Error Sending Mail <BR>")
else
objMail.ServerAddress = "fake.fake.fake"
objMail.AddRecipient("blah
objMail.Sender = "fake@fake.fake"
objMail.Subject="Proposals
‘objMail.AddAttachment( "C:\INETPUB\WWWROOT\angie\
'objMail.AddAttachment(Ser
objMail.AddAttachment(Atta
objMail.Body=body
objMail.Execute
end if
set objMail=nothing
end function
dim Recipient1
if strCount > 0 then
'********************
dim emailBody
dim strBody
strBody= "Name: " & fName & " " & lName
strBody=strBody & chr(10) & "Comments: " & Comments
strBody=strBody & chr(10) & "Date Submitted: " & DateSubmitted & vbCrLf
emailBody=strBody
sendEmail emailBody, Recipient1 'send email if the data was submitted correctly
else ' (RecordCount = -1 means that ADO could not find any records)
dim noDataEBody
noDataEBody = "The form you submitted did not reach the database. “
sendEmail noDataEBody, Recipient1 'call function, send email if the data did not make it to the database
end if
rsErrorCheck.close
set rsErrorCheck = nothing
conect.Close
Set conect = Nothing
%>
<center>Your proposal has been submitted!</center>
ASKER
The "Attachment" variable from this line of code Attachment = Request.Form("attach1")
gets the path (C:\INETPUB\WWWROOT\angie\ form.txt) for the file which needs to be attached to the email
This path is always differnet depending on what file the user wants to attach...
It comes from this BROWSE text box: <INPUT TYPE="FILE" NAME="attach1" size = "35"> from a file called "submit.asp"
Here is some of its code:
<FORM METHOD="POST" ACTION="ProposalsReceived. asp" onSubmit="return validate(this)" id = "ProposalsForm" name = "ProposalsForm" ENCTYPE="multipart/form-da ta" >
First Name: <INPUT NAME="FName" VALUE="" size=30>
Last Name: <INPUT NAME="LName" VALUE="" size=30>
Comments: <TEXTAREA NAME="Comments" rows=15 cols=50 virtual=wrap></TEXTAREA>
Attach File: <INPUT TYPE="FILE" NAME="attach1" size = "35">
<INPUT type="submit" value="Upload" name="submit" style = "background:#0D6B9C; font-weight:bold; color:#FFFFFF;">
</FORM>
gets the path (C:\INETPUB\WWWROOT\angie\
This path is always differnet depending on what file the user wants to attach...
It comes from this BROWSE text box: <INPUT TYPE="FILE" NAME="attach1" size = "35"> from a file called "submit.asp"
Here is some of its code:
<FORM METHOD="POST" ACTION="ProposalsReceived.
First Name: <INPUT NAME="FName" VALUE="" size=30>
Last Name: <INPUT NAME="LName" VALUE="" size=30>
Comments: <TEXTAREA NAME="Comments" rows=15 cols=50 virtual=wrap></TEXTAREA>
Attach File: <INPUT TYPE="FILE" NAME="attach1" size = "35">
<INPUT type="submit" value="Upload" name="submit" style = "background:#0D6B9C; font-weight:bold; color:#FFFFFF;">
</FORM>
please see your other post.
you will need to modify your email function, as with the way you have it now, will go to no-one.
you will need to modify your email function, as with the way you have it now, will go to no-one.
ASKER
Actually this code works, but only when I attach a file from my webserver, not from my desktop and I use this code:
'objMail.AddAttachment(Ser ver.MapPat h(Attachme nt))
I am trying to get it to work, when I attach a file from my desktop...
'objMail.AddAttachment(Ser
I am trying to get it to work, when I attach a file from my desktop...
ASKER
As I understand it the idea is to upload the desktop file on my web server and then it will work... Please let me know if I am wrong about this...
This means that you don't have the Persists.Upload object registered on your web server.
Do you have access to the applicable DLL? That's what you need to resolve this issue.
Thanks,
Phil / peh803