Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    Object not a collection ?!?!?!?

    Salve...
    mi esce questo errore:


    Microsoft VBScript runtime error '800a01c3'

    Object not a collection

    /demo/_get2.asp, line 26


    la riga 26 è:
    For Each SubKey in pth(Request.form("getfile"))

    pth è una funziona che definisco all'inizio della pagina:
    Function pth(getfile)
    stepA = Replace(getfile,"::","\\")
    stepB = Replace(stepA,":","\")
    pth = stepB
    End Function


    Perkè mi sa quell'errore?!?!
    grazie
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

  2. #2
    Perchè Request.form("getfile") non è una collezione di elementi.
    Request.form invece sì.

  3. #3
    dall'alto della mia ignoranza....

    e quindi?!?!

    cosa devo fare?
    non capisco...
    mai fatte ste cose... sto aiutando un'amico... :S
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

  4. #4
    LA domanda non è cosa devi fare ma cosa vuoi fare.
    Se hai scritto quel codice ci sarà un motivo...

  5. #5
    praticamente quel codice (non l'ho fatto io.. è na bega che mi sono preso :S )
    dovrebbe prendere tutta una serie di immagini che si trovano in un "carrello" e zipparle...
    ecco tutto il codice...

    codice:
    <% 
    Function pth(getfile)
    stepA = Replace(getfile,"::","\\")
    stepB = Replace(stepA,":","\")
    pth  = stepB
    End Function
    
    
    'Set Tools = Server.CreateObject("MSWC.Tools")
    'zTime = cstr(Minute(now)) & cstr(second(now)) & ( Abs( Tools.Random ) ) 
    
    intFileCount = 0
    
    'Set the temporary directory
    ZipDir = "f:\aspfile\" 
    
    'Instantiate the AciveFile Components
    Set Dir = Server.CreateObject("ActiveFile.Directory")
    Set File = Server.CreateObject("ActiveFile.File")
    Set Arch = Server.CreateObject("ActiveFile.Archive")
    Dir.Path = ZipDir
    
    'Loop through the form request for each file's path and add them to the zip file.
    
    
    For Each SubKey in pth(Request.form("getfile"))
    
    
    	intFileCount = intFileCount + 1
    	TempPath = pth(Request.form("getfile"))(intFileCount)
    	ZipFile = ZipDir & "infophoto.zip"
    	File.Name = ZipFile
            If Not Dir.Exists() Then
              Dir.Create ZipDir
            End If
    
            If Not File.Exists() Then
               Arch.NewArchive ZipFile
               Arch.SaveArchive
            End If
            Arch.OpenArchive ZipFile
            Arch.Add TempPath,false,false
            Arch.SaveArchive      
            Arch.CloseArchive    		
    Next
    
    'Download the zip file to the browser.
    Response.AddHeader "Content-Disposition", "inline; filename=" & File.FileName
    ' Download the file
    	If File.Download("application/x-zip-compressed", Now(), false, true) Then
    
    		Session("TRANSFEROK") = "SCARICATO"
    ' Connessione al Db Access
    		Set conn = Server.CreateObject("ADODB.Connection")
    		conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("datadownload.mdb")
    ' query sul Db
    		sql = "SELECT * FROM DATA "
    		Set rsData = Server.CreateObject("ADODB.Recordset")
    		
    arrDate = Split(Date,"/")
    		rsData.Open sql, conn, 3, 3
    Cont = 0		
    	For Each SubKey in pth (Request.Form("getfile"))
    		Cont = Cont + 1
    			rsData.AddNew
    				rsData.Fields("DATA") 		= 	Date
    				rsData.Fields("aaaa") 		= 	arrDate(2)
    				rsData.Fields("mm") 	    	= 	arrDate(0)
    				rsData.Fields("gg") 	    	= 	arrDate(1)
    				rsData.Fields("ORA") 		=	Time()		
    				rsData.Fields("STATUS") 	= 	Request.Form("getfile")(Cont)		
    				rsData.Fields("IMAGE") 		= 	Request.ServerVariables("LOGON_USER")	
    				rsData.Fields("SOGGETTO") 	= 	Request.Form("soggetto")(Cont) 
    				rsData.Fields("FOTOGRAFO") 	= 	Request.Form("fotografo")(Cont)
    				rsData.Fields("FILENAME") 	= 	Request.Form("Filename")(Cont)	
    				rsData.Fields("IP_HOST") 	= 	Request.ServerVariables("REMOTE_HOST")
    				rsData.update		
    	Next
    			rsData.Close
    			conn.Close
    		Response.End
    	End If
    		
      Set File = Nothing      
    %>
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

  6. #6
    UP
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.