Solved

File upload error

Posted on 2004-09-30
8
3,364 Views
Last Modified: 2012-06-22
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("Persits.Upload")
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("SoftArtisans.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"
0
Comment
Question by:MaximusMeridus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 11

Expert Comment

by:coopzz
ID: 12189306
Well the new object your wanting to use is different to the other one.. so naturally they don't share the same interface.

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

Author Comment

by:MaximusMeridus
ID: 12189355
Is it possible that you adjust the code relevantly as I am not that experienced.

Many thanks

Max
0
 
LVL 11

Accepted Solution

by:
coopzz earned 500 total points
ID: 12189454
don't know never used the object but looking at the demo in the first link it'd be something like this.

If id="add2" then
     set upl=Server.CreateObject("Persits.Upload.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"

if you can't get it to work try the demo and download it, get it going and play with it and you'll get it.
It can't be that hard.. just make sure you have permission to upload to the directory that your uploading to.
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 1

Author Comment

by:MaximusMeridus
ID: 12189672
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("Persits.Upload.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(bigContent)
      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,adOpenForwardOnly,adLockOptimistic
      rs.addnew
      rs.Fields("pub_date").value =  pdate
      rs.fields("headline").value = 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
0
 
LVL 11

Expert Comment

by:coopzz
ID: 12189801
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").value)

I take it "fname" is the name of the input form object
0
 
LVL 1

Author Comment

by:MaximusMeridus
ID: 12190245
Now I get this error...:(

Persits.Upload.1 error '800a0009'

Index out of range.

/admin/publication.asp, line 149
0
 
LVL 11

Expert Comment

by:coopzz
ID: 12190312
whoopa I think maybe this should be
rs.Fields("fname").value = Cstr(upl.form(1).value) 'note the 1 has changed from 0.
0
 
LVL 1

Author Comment

by:MaximusMeridus
ID: 12190914
You're a star!

Excellent!

Max
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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/…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

624 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