Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtaining the size of a file

Status
Not open for further replies.

Dabase

Programmer
Apr 2, 2004
122
PT
Hi,

I am trying to obtain the size of file that resizes on the server where the ASP application is hosted. Is there any way of achieving this in ASP?

Any help would be appreciated.

Thanks
Dabase
 
Some code to get started...

Code:
Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject")

Dim Filepath
Filepath = Server.MapPath(Filename)
if FSO.FileExists(Filepath) Then

	Dim file	
	set file = FSO.GetFile(Filepath)

	Dim FileSize
	FileSize = file.Size

	Response.Write "<p><b>File: " & Filename & " (size " & FileSize  &_
		           " bytes)</b></p>"

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top