Ciao a tutti, credo che l'errore sia banale, ma non riesco a trovarlo![]()
Quello che devo fare è leggere in una dir due file (fileavvi1.zip e fileavvi2.zip) e dopo aver verificato se esistono, calcolarne la dimensione.
Ora il seguente errore
me lo dà sul secondo file (in ordine di controllo) e il file esistecodice:Errore di run-time di Microsoft VBScript (0x800A01A8) Necessario oggetto /downfileavvifaxx.asp, line 153![]()
Posto il codice, dove la riga evidenziata in rosso è quella incriminata.
Qualche consiglio?
![]()
codice:<% vc_user = session("vc_userprop") Dim strURL Dim con Dim rs Dim strDBPath Dim sql vc_userconn =session("vc_userprop") if vc_userconn ="" then response.redirect "timeoutt.asp" end if strURL = Request.ServerVariables("URL") %> <form name="datiform" action="<%= strURL %>" method="get"> <table class="tabellavisu" cellspacing="0" cellpadding="0" border="0" width="30%"> <% ' 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! Il fileavvi1.zip non esiste </p> </p> <% End If Set objFile = Nothing %> <% ' Nome del file da scaricare fname2 = "docuavvi\file\fileavvifaxx\fileavvi2.zip" If objFile.FileExists (Server.MapPath(fname2)) Then ' Response.Write "Il file esiste!" %> <tr> <td class="testolabel"> fileavvi2.zip </td> <td class="testolabel"> <% Function GetFileSize(filepath2) Dim fso, f Set fso = Server.CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(filepath2) '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 fname2, fpath2 fpath = Server.MapPath(fname2) GetFileSize(fpath2) %> <td class="testolabel"> [img]images/zip.jpg[/img] </td> </tr> <% Else 'Response.Write "Il file NON esiste." %> <p class="errori" > Attenzione! Il fileavvi2.zip non esiste </p> </p> <% End If Set objFile = Nothing %>

Rispondi quotando