Need to display file size on ASP-page

Evert Jor
Evert Jor used Ask the Experts™
on
I need to display the file size of an image file on a page. I think it should be possible by a VB-script. I can get the file path from a database and use that in the script, but how do I get the file size? Any suggestions are appreciated. Thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018
Commented:
Web Ninja at large
Commented:
Create a FSO (FileSystemObject) handle to your file and check the SIZE property
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
This is for ASP.NET (C#). For VBScript use the other suggestions
FileInfo fileInfo = new FileInfo(filePath);
long fileSize = fileInfo.Length;

Open in new window

Big MontyWeb Ninja at large

Commented:
best solutions

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial