Click to See Complete Forum and Search --> : Filesize in ASP
richy
Jul 6th, 2001, 07:13 AM
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?
JoshT
Jul 6th, 2001, 12:52 PM
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.
John Yingling
Jul 6th, 2001, 01:05 PM
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
JoshT
Jul 6th, 2001, 01:26 PM
Um, or you could do it the easy way...
:D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.