|
-
May 15th, 2001, 03:58 AM
#1
File size ?
How can i find the filesize of a file , say "http://www.yahoo.com/something.exe" from vb ? Please help as i am a beginner.
-
May 15th, 2001, 07:12 AM
#2
Re: File size ?
Dim filesys As Object
Dim f As Object
Set filesys = CreateObject("Scripting.FileSystemObject")
Set f = filesys.GetFolder(folderpath)
Msgbox f.Size
Iouri Boutchkine
[email protected]
-
May 16th, 2001, 01:31 AM
#3
Re: File size ?
I want to find the file size without downloading the file...
-
December 21st, 2001, 03:54 PM
#4
Re: File size ?
Here you go, gets the size of a file w/o downloading the file. Using Internet Transfer Control.
Private Sub Command1_Click()
Inet1.URL = "http://www.yahoo.com/something.exe"
Inet1.Execute , "HEAD"
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim DocSize As Long
Select Case State
Case icResponseCompleted
If Len(Inet1.GetHeader("Content-Length")) > 0 Then
DocSize = CLng(Inet1.GetHeader("Content-Length"))
Text1.Text = DocSize ' <----- This puts the Size of the file in a text box
End If
End Select
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|