Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    N. Ireland
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asp upload error

    hi im using persits asp upload butr i have run into an error. I add data to database and upload images, but i have used basicaslly the same form for edit of that data and the same basic code to update the data as i use to add it. Adding gives no problem but updating gives this error. ive tried chopping and changing but i cant get by this.

    error is:
    -----------------------------------------------
    Microsoft VBScript runtime error '800a01a8'

    Object required: 'Upload.Files(...)'

    -------------------------------------------------


    To add files i have first asp page:

    Code:
    <form action="diaryaddprocess.asp" method="post" enctype="multipart/form-data" name="frmadd">
    <input name="file1" type="file" size="35" />
    <input name="txtDate" type="hidden" value="<%=TodayDate%>"  />
    </form>
    And second asp page

    Code:
    	Set Upload = Server.CreateObject("Persits.Upload.1")
    
    	Upload.OverwriteFiles = False
    	Upload.SetMaxSize 1048576	' Limit files to 1MB
    	Count = Upload.SaveVirtual("/imagesupload/")
    
    	StrPic1 = Upload.Files("file1").filename
    	DatDate = Upload.Form("txtDate")
    I use exactly the same for editing and updating the data but i get the above error. I cant see anything else wrong. obviously i have removed a lot of code from above example but i have also removed everything from the update process page except for this

    Code:
    	Set Upload = Server.CreateObject("Persits.Upload.1")
    	Upload.OverwriteFiles = False
    	Count = Upload.SaveVirtual("/imagesupload/")
    
    	StrPic1 = Upload.Files("file1").filename
                 response.write StrPic1
    i then get this error

    ---------------------------------------
    Microsoft VBScript runtime error '800a01a8'

    Object required: '[object]'
    -------------------------------------------

    im trying to figure out the change in error but im stuck, almost forgot the important bit - the images are being uploaded to the folder but i cant get the rest of the data. problem seems to be on this line :

    StrPic1 = Upload.Files("file1").filename
    ska

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    N. Ireland
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well after 48 hours of failure i finally posted here in desperation but now i have solved it, hopefully permanently - i had a couple false dawns! Well simple solution was i should have checked to see if a new image was being uploaded or if the file field was left blank. When it was blank it seemed to crash, but for a while it also crashed when i filled all 3 file fields used. thing is i have done this exactly the same as above on 3 other pages and they dont crash when the field is blank.

    Code:
    Set File = Upload.Files("file1")
    If Not File Is Nothing Then
       StrPic1 = Upload.Files("file1").filename
    End If 
    
    
    Set File = Upload.Files("file2")
    If Not File Is Nothing Then
      StrPic2 = Upload.Files("file2").filename
    End If
    ska


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •