Link to home
Start Free TrialLog in
Avatar of cbomik
cbomik

asked on

Persits.Upload.1 error '800a0028' Error in ASP Form

I have a form on a webpage on my site where people input information and upload pictures . The webpage is caled Ladiesapplication.asp.    When the Submit button was pushed the information would go into a Access database on the host server and the pictures would go into a file.  Recently I changed my hosting company from webhost4life to Godaddy and now when I  attempt to use the form I am getting the following error message:
(Note:  I have pasted the upload.asp)

c:\hosting\webhost4life\member\misnstt\uploaded\SMithJohn
Files:

Persits.Upload.1 error '800a0028'

This feature has been disabled by system administrator. Use File.SaveAsVirtual instead.

upload.asp, line 63
*********************************************************************************************

Thie Is The Upload.asp___________________________________________________________________
<%

Set Upload = Server.CreateObject("Persits.Upload")
upload.save
%>

<%
address = upload.form("address")
lastname = upload.form("lname")
firstname = upload.form("fname")
mmth = upload.form("mmth")
mday = upload.form("mday")
myr= upload.form("myr")
citytown = upload.form("citytown")
email = upload.form("email")
hphone = upload.form("hphone")
wphone = upload.form("wphone")
cphone = upload.form("cphone")
mlookage = upload.form("mlookage")
languages = upload.form("lanaguages")
religion = upload.form("religion")
mmar = upload.form("mmar")
mchild = upload.form("mchild")
profession = upload.form("profession")
mheight = upload.form("mheight")
mweight = upload.form("mweight")
measurments = upload.form("measurments")
hobbies = upload.form("hobbies")
notes = upload.form("notes")
details = upload.form("details")

Function CheckString(byval strText)
    strText = Replace(strText, "'", "''")
    If strText = "" Then
        CheckString = "Blank"
    Else
       CheckString = strText
    End if
End Function

function checkstring2(byval strtext)
      strtext = replace(strtext, "'","")
      checkstring2 = strtext
end function

%>

<%
foldername = checkstring2(lastname) + checkstring2(firstname)
filepath = "c:\hosting\webhost4life\member\misnstt\uploaded\" & foldername
response.write filepath & "<br>"
upload.createdirectory filepath, True
%>

Files:<BR>
<%
set conn = server.createobject("adodb.connection")
constr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\info.mdb")
conn.open constr

Set rs = Server.CreateObject("adodb.recordset")
For Each File in Upload.Files
file.saveas filepath & "\" & file.filename
fname = file.filename
response.write fname & "<br>"
sqlstr = "Insert into FileName(foldername, filename) Values('" & foldername & "', '" & fname & "')"
conn.execute(sqlstr)
Next

%><%
conn.close
set conn = nothing
set constr = nothing
%><%
set conn = server.createobject("adodb.connection")
constr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\info.mdb")
conn.open constr


valuestr = "values('" & foldername & "', '" & checkstring(lastname) & "','" & checkstring(firstname) & "', "
valuestr = valuestr & "'" & checkstring(mmth) & "','" & checkstring(mday) & "','" & checkstring(myr) & "','" & checkstring(address) & "'"
valuestr = valuestr & ",'" & checkstring(citytown) & "','" & checkstring(email) & "','" & checkstring(hphone) & "','" & checkstring(wphone) & "'"
valuestr = valuestr & ",'" & checkstring(cphone) & "','" & checkstring(mLookAge) & "','" & checkstring(languages) & "','" & checkstring(religion) & "'"
valuestr = valuestr & ",'" & checkstring(mMar) & "','" & checkstring(mChild) & "','" & checkstring(profession) & "','" & checkstring(mHeight) & "'"
valuestr = valuestr & ",'" & checkstring(mWeight) & "','" & checkstring(Measurments) & "','" & checkstring(Hobbies) & "','" & checkstring(Notes) & "','" & checkstring(Details) & "')"
sqlstr = "Insert into data(foldername, lname, fname, mMth, mDay, mYr, address, citytown, email, hphone, wphone, cphone, mLookAge,"
sqlstr = sqlstr & " languages, religion, mMar, mChild, profession, mHeight, mWeight, Measurments, Hobbies, Notes, Details)"
sqlstr = sqlstr & valuestr

conn.execute(sqlstr)

conn.close
set conn = nothing
set constr = nothing
%><%
response.redirect("thankyou.asp")
%>
Avatar of blandyuk
blandyuk
Flag of United Kingdom of Great Britain and Northern Ireland image

You can use the:
Upload.SaveAsVirtual "[virtual-path]"

If you are storing files in say:
www.mydomain.com/files/
----------------
Upload.SaveAsVirtual "/files/"

and then simply use the File object to get the file names.
Avatar of cbomik
cbomik

ASKER

Im sorry I am a novice at this.  I didnt develop that Upload.asp form I paid a person.  Could you tell me where I will put that path within the Upload.asp? And more or less how I would write it?
THanks
Ah :) OK. The "Upload.Save" function saves the file data into memory, from there you can use the File object to save them off. This is what your script is currently doing. In order to change this, find the following code:

<%
Set Upload = Server.CreateObject("Persits.Upload")
upload.save
%>

and change it to:

<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.SaveAsVirtual "/files/"
%>

You'll need to create that directory in the root folder of the website, (root being the top level directory). This "should" save the files in there. You probably need to set Write permissions on that folder from IIS. Try it anyway, if you get "Access Denied" that you'll need to do that.

Very messy script that thou :( Can be done a lot better.
Your website wouldn't be:

http://www.colombianbeautiesonline.com/

by any chance lol ;)

Google Search for: Ladiesapplication.asp
Avatar of cbomik

ASKER

Hello,
Yes that is me
I will set you up with all you want if you can figure this out for me.

I changed host companies because I thought that was the problem.

Now I am getting this:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/upload.asp, line 3

800401f3
Line 3 is:
-------------
Set Upload = Server.CreateObject("Persits.Upload")
-------------

Try this instead, it's normally how you call the Persits Upload object:

-------------
Set Upload = Server.CreateObject("Persits.Upload.1")
-------------

If you still get, "Server.CreateObject Failed", then it looks like there is something wrong with the object on the server as it should at least create the object.

I could have a look for you and see if I can provide a solution. I'll obviously need details with regards to gaining access etc. Obviously you would be entailing trust in me here but I am ok :)

Contact me via my contact page at:
http://www.blandyuk.co.uk/contact.asp
ASKER CERTIFIED SOLUTION
Avatar of blandyuk
blandyuk
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial