MaximusMeridus
asked on
File upload error
Hi all,
I have a problem,
I have adjusted a file that used the "SoftArtisans Fileup" upload script to change it to use the "aspupload" script.
I get the following error......Please help !!! :( what am I doing wrong?
ERROR------
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'upl.path'
/admin/publication.asp, line 120
CODE----
LINE 18 If id="add2" then
LINE 19 set upl=Server.CreateObject("P ersits.Upl oad")
LINE 20 upl.path=(server.mapPath(" /articles" ))
etc if not (upl.IsEmpty) then
upl.save
End If
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB .Recordset ")
SQL = "SELECT * FROM Articles where id is null"
ORIGINAL CODE-----
If id="add2" then
set upl=Server.CreateObject("S oftArtisan s.FileUp")
upl.path=("d:\web\articles ")
if not (upl.IsEmpty) then
upl.save
End If
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB .Recordset ")
SQL = "SELECT * FROM Articles where id is null"
I have a problem,
I have adjusted a file that used the "SoftArtisans Fileup" upload script to change it to use the "aspupload" script.
I get the following error......Please help !!! :( what am I doing wrong?
ERROR------
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'upl.path'
/admin/publication.asp, line 120
CODE----
LINE 18 If id="add2" then
LINE 19 set upl=Server.CreateObject("P
LINE 20 upl.path=(server.mapPath("
etc if not (upl.IsEmpty) then
upl.save
End If
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB
SQL = "SELECT * FROM Articles where id is null"
ORIGINAL CODE-----
If id="add2" then
set upl=Server.CreateObject("S
upl.path=("d:\web\articles
if not (upl.IsEmpty) then
upl.save
End If
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB
SQL = "SELECT * FROM Articles where id is null"
ASKER
Is it possible that you adjust the code relevantly as I am not that experienced.
Many thanks
Max
Many thanks
Max
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi I tried the following and go this message....the end is LINE 150
ERROR ----
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Field 'Articles.fname' cannot be a zero-length string.
/admin/publication.asp, line 150
CODE---
If id="add2" then
set upl=Server.CreateObject("P ersits.Upl oad.1")
upl.OverwriteFiles = False
'On Error Resume Next
upl.SetMaxSize 1048576 ' Limit files to 1MB
dim Count: Count = upl.Save(server.mapPath("/ articles") )
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB .Recordset ")
SQL = "SELECT * FROM Articles where id is null"
Dim bigContent
'for i=1 to upl.Form("content").Count
' bigcontent = content & upl.Form("content")(i)
'Next
bigContent = upl.Form("content")
bigContent=sortit(bigConte nt)
pdate = upl.Form("pub_date")
StrDay = Mid(pdate, 1,2)
StrMonth= Mid(pdate,4,2)
StrYear= Mid(pdate,7,2 )
'pdate = StrMonth & "/" & StrDay & "/" & StrYear
rs.open sql,dbconn,adOpenForwardOn ly,adLockO ptimistic
rs.addnew
rs.Fields("pub_date").valu e = pdate
rs.fields("headline").valu e = CStr(upl.Form("headline"))
rs.fields("content").value = bigContent
rs.fields("publication_Id" ).value = CStr(upl.Form("publication "))
'Response.Write("Fname: " & upl.form("fname"))
rs.Fields("fname").value = Cstr(upl.form("fname"))
rs.update
ERROR ----
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Field 'Articles.fname' cannot be a zero-length string.
/admin/publication.asp, line 150
CODE---
If id="add2" then
set upl=Server.CreateObject("P
upl.OverwriteFiles = False
'On Error Resume Next
upl.SetMaxSize 1048576 ' Limit files to 1MB
dim Count: Count = upl.Save(server.mapPath("/
response.write("<h6>:: Add Article ::</h6>")
Set rs = Server.CreateObject("ADODB
SQL = "SELECT * FROM Articles where id is null"
Dim bigContent
'for i=1 to upl.Form("content").Count
' bigcontent = content & upl.Form("content")(i)
'Next
bigContent = upl.Form("content")
bigContent=sortit(bigConte
pdate = upl.Form("pub_date")
StrDay = Mid(pdate, 1,2)
StrMonth= Mid(pdate,4,2)
StrYear= Mid(pdate,7,2 )
'pdate = StrMonth & "/" & StrDay & "/" & StrYear
rs.open sql,dbconn,adOpenForwardOn
rs.addnew
rs.Fields("pub_date").valu
rs.fields("headline").valu
rs.fields("content").value
rs.fields("publication_Id"
'Response.Write("Fname: " & upl.form("fname"))
rs.Fields("fname").value = Cstr(upl.form("fname"))
rs.update
try replacing this
rs.Fields("fname").value = Cstr(upl.form("fname"))
with
rs.Fields("fname").value = Cstr(upl.form(0).value) 'or
rs.Fields("fname").value = Cstr(upl.form(("fname").va lue)
I take it "fname" is the name of the input form object
rs.Fields("fname").value = Cstr(upl.form("fname"))
with
rs.Fields("fname").value = Cstr(upl.form(0).value) 'or
rs.Fields("fname").value = Cstr(upl.form(("fname").va
I take it "fname" is the name of the input form object
ASKER
Now I get this error...:(
Persits.Upload.1 error '800a0009'
Index out of range.
/admin/publication.asp, line 149
Persits.Upload.1 error '800a0009'
Index out of range.
/admin/publication.asp, line 149
whoopa I think maybe this should be
rs.Fields("fname").value = Cstr(upl.form(1).value) 'note the 1 has changed from 0.
rs.Fields("fname").value = Cstr(upl.form(1).value) 'note the 1 has changed from 0.
ASKER
You're a star!
Excellent!
Max
Excellent!
Max
ie: it dont' support this property or method (upl.path...)
you have to rewrite the upload saving to the new object.
heres some links to get you going
http://support.persits.com/upload/demo1.asp
http://www.aspupload.com/object_upload.html
http://www.aspupload.com/ObjectReference.htm