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 %>


Rispondi quotando