I have the file path of a file, and now want to find out the size of this file. Is there anyway that I can do this in ASP?
Printable View
I have the file path of a file, and now want to find out the size of this file. Is there anyway that I can do this in ASP?
You could write a COM DLL in VB you could call from ASP to get the info. Look into the FindFirstFile API call and the WIN32_FIND_DATA structure.
Code:Dim fs
Dim f
Dim vSize
Set fs = Server.CreateObject("Scripting.FileSystemObject")
if fs.FileExists(strFileName) then
set f = fs.GetFile(strFileName)
vSize = f.size
else
........
End if
Set f = Nothing
Set fs = nothing
Um, or you could do it the easy way...
:D