%@ Language=VBScript %>
<%
Dim strPath 'Path della directory da mostrare
Dim objFSO 'FileSystemObject
Dim objFolder 'Folder
Dim objItem
Dim rstFiles
Const adVarChar = 200
Const adInteger = 3
Const adDate = 7
strPath = "documenti/"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(strPath))
%>
Studio Notarile Dott. Mauro Borghi
Contenuto cartella documenti |
- Nome File |
- Dimensione File (bytes) |
- Data Creazione |
<%
Set rstFiles = Server.CreateObject("ADODB.Recordset")
rstFiles.Fields.Append "name", adVarChar, 255
rstFiles.Fields.Append "size", adInteger
rstFiles.Fields.Append "date", adDate
'rstFiles.Fields.Append "type", adVarChar, 255
rstFiles.Open
For Each objItem In objFolder.Files
rstFiles.AddNew
rstFiles.Fields("name").Value = objItem.Name
rstFiles.Fields("size").Value = objItem.Size
rstFiles.Fields("date").Value = objItem.DateCreated
' rstFiles.Fields("type").Value = objItem.Type
Next
if rstFiles.RecordCount>0 then
Set objItem = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
rstFiles.Sort = "size ASC, date DESC"
rstFiles.MoveFirst
Do While Not rstFiles.EOF
%>
<%= rstFiles.Fields("name").Value %> |
<%= rstFiles.Fields("size").Value %> |
<%= rstFiles.Fields("date").Value %> |
<% rstFiles.MoveNext
Loop
ELSE
%>
Nessun file presente |
<%
end if
rstFiles.Close
Set rstFiles = Nothing
%>