?
Solved

Server.CreateObject Failed

Posted on 2006-06-30
32
Medium Priority
?
846 Views
Last Modified: 2007-11-27
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("Persits.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-data" 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("Persits.Upload")
Count = Upload.Save("c:\upload")
Response.Write Count & " file(s) uploaded to c:\upload"
%>
</BODY>
</HTML>


Can you help me?
0
Comment
Question by:Gemini532
  • 20
  • 7
  • 5
32 Comments
 
LVL 19

Expert Comment

by:peh803
ID: 17018176
Hey there --

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
0
 
LVL 19

Expert Comment

by:peh803
ID: 17018186
Sorry -- the DLL should be called "aspupload.dll"...

Thanks,
Phil
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17018708
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
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Gemini532
ID: 17018951
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?
0
 

Author Comment

by:Gemini532
ID: 17018973
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?
0
 
LVL 19

Accepted Solution

by:
peh803 earned 1000 total points
ID: 17019180
Absolutely, you can do this for free using an ASP upload class.  Here's a comparison of several, some of which are free:

http://www.taka.nl/programming/asp/comparing_fileupload.asp

I've used the PseudoRequestDictionary code with a lot of success.  Try it out, I think you'll like it.  And it never will cost you money.  And it gives you all kinds of upload functionality -- probably more than you'll ever need.

Thanks,
Phil
0
 

Author Comment

by:Gemini532
ID: 17019410
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?
0
 
LVL 19

Expert Comment

by:peh803
ID: 17019417
Are you using the PseudoRequestDictionary now, which is what this question is about?
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21904538.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
0
 
LVL 19

Expert Comment

by:peh803
ID: 17019435
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
0
 

Author Comment

by:Gemini532
ID: 17020081
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")

0
 

Author Comment

by:Gemini532
ID: 17020088
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...  
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17020208
please see here for attachments with JMail:
http://www.webmage.com/support/jmail.asp#AddAttachment
0
 

Author Comment

by:Gemini532
ID: 17020245
I tried this code, but it didn't work  EVEN THOUGH there a file by this name in my c: drive       objMail.AttachFile("c:\images\form.txt")

 
<%
  Option Explicit
 
  Dim objMail
  Set objMail = Server.CreateObject("CDONTS.NewMail")
 
     objMail.From = "friend@somewhere.com"
     objMail.Subject = "A message TO you"
     objMail.AttachFile("c:\images\form.txt")
     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
%>


0
 

Author Comment

by:Gemini532
ID: 17020283
I get this error:


error '80004005'
Unspecified error

/investment/ProposalsReceived.asp, line 137


From this line:   objMail.AttachFile("c:\images\form.txt")
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17020318
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.
0
 

Author Comment

by:Gemini532
ID: 17020329
This isn't working either:
JMail.AddAttachment( "c:\\angie/form.txt" )

Is this javascript?  I need VBScript...

0
 

Author Comment

by:Gemini532
ID: 17020687
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(Server.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?
0
 

Author Comment

by:Gemini532
ID: 17020692
path = "c:/angie/readme.txt"       <-- if it's real path
0
 

Author Comment

by:Gemini532
ID: 17020702
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
0
 

Author Comment

by:Gemini532
ID: 17020723
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:\temp\testdocument.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/testdocument.doc"))
0
 

Author Comment

by:Gemini532
ID: 17020741
It says:  The file must be local to the server.
0
 

Author Comment

by:Gemini532
ID: 17020753
so to make this file local to the server, is that why I need to use the Persists.Upload object ?!?
0
 

Author Comment

by:Gemini532
ID: 17020762
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?
0
 
LVL 25

Assisted Solution

by:kevp75
kevp75 earned 1000 total points
ID: 17021112
slow down.

first off, what email component are you using.  Is it JMail, or is it CDONTS, because the code you posted is CDONTS and NOT JMail.

2nd off, the reason what this will not work:
path = "c:/angie/readme.txt"
is because it is not the correct path, it should be...
path = "c:\angie\readme.txt"

try correcting the path and see if it works before we go any further
0
 

Author Comment

by:Gemini532
ID: 17031116
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/ProposalsReceived.asp, line 197

The folder angie has "write" permissions...
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17031318
ok, please post your whole code for ProposalsReceived.asp
0
 

Author Comment

by:Gemini532
ID: 17031864
<%
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.Connection")
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.Connection")
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.CreateObject("Jmail.SMTPMail")
            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(Server.MapPath(Attachment))
                  objMail.AddAttachment(Attachment)            
                  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>
0
 

Author Comment

by:Gemini532
ID: 17031916
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-data" >

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>
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17032574
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.
0
 

Author Comment

by:Gemini532
ID: 17042602
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(Server.MapPath(Attachment))

I am trying to get it to work, when I attach a file from my desktop...
0
 

Author Comment

by:Gemini532
ID: 17042616
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...
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question