Salve a tutti,
attualmente utilizzo il codice (che posto alla fine) per leggere la presenza di un file (fileavvi1.zip) all'interno di una dir locale.
Il tutto funziona perfettamente.
Ora però ho l'esigenza di leggere non 1, ma n-file (fileavvi1.zip fileavvi2.zip etc...) all'interno della stessa dir.
Credo che sia abbastanza semplice (non per me chiaramente) modificare questo codice. Mi potete dare una mano?
codice:<% ' Nome del file da scaricare fname = "docuavvi\file\fileavvifaxx\fileavvi1.zip" Dim objFile Set objFile = Server.CreateObject ("Scripting.FileSystemObject") If objFile.FileExists (Server.MapPath(fname)) Then ' Response.Write "Il file esiste!" %> <tr> <td class="rigatabella" width="10%"> Nome File </td> <td class="rigatabella" width="10%"> Dimensione (in kb) </td> <td class="rigatabella" width="10%"> Download </td> </tr> <tr> <td class="testolabel"> fileavvi1.zip </td> <td class="testolabel"> <% Function GetFileSize(filepath) Dim fso, f Set fso = Server.CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(filepath) 'Response.Write("La dimensione del file è: ") 'Response.Write(FormatNumber(f.Size/1024, 2)&" Kb") %> <%=FormatNumber(f.Size/1024, 2)%> </td> <% Set f = nothing Set fso = nothing End Function Dim fname, fpath fpath = Server.MapPath(fname) GetFileSize(fpath) %> <td class="testolabel"> [img]images/zip.jpg[/img] </td> </tr> <% Else 'Response.Write "Il file NON esiste." %> <p class="errori" > Attenzione! Non risultano file da scaricare </p> </p> <% End If Set objFile = Nothing %>

) modificare questo codice. Mi potete dare una mano?
Rispondi quotando