programming-examples/asp/FilesMaths/File Length Function.asp
2019-11-18 14:25:58 +01:00

16 lines
404 B
Plaintext

<%
Private Function FileLen(ByVal pathname)
Dim objFSO, objFile
On Error Resume Next
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(pathname)
If Err Then
FileLen = Null
Else
FileLen = CLng( objFile.Size )
End If
Set objFile = Nothing
Set objFSO = Nothing
On Error GoTo 0
End Function
%>