get file download size

  • Thread starter Thread starter Abubakar
  • Start date Start date
A

Abubakar

Hi,
I want to know the size of a given file on the server before downloading it.
Say I'v a zip file whose url I know, now I want to know what size it is on
the server.


Thanx,

Abubakar.
 
Use the System.IO.FileInfo Object. It has a property called Length,
which is the size.

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Dim di as new DirectoryInfo(strPath) 'Create DirectoryInfo object, in this
case, the path is your temp folder
Dim fi as FileInfo() = di.GetFiles() 'Create an array to hold the info of
all the files in the directory
Dim fiTemp as FileInfo

'Loop thru each element in the array to print the file size
For Each fiTemp in fi
console.writeline(fi.length)
next


-Calvin Luttrell
www.projectthunder.com
Enter to win a XBOX or a Portable DVD Player
Monitored forums www.projectthunder.com/forums
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top