|
-
Feb 11th, 2000, 02:37 AM
#1
Thread Starter
New Member
How can we get the file size with the HTTP protocol
like http://mtv3.webjump.com/....zip ?
Please help
Thanx in advance
John
-
Feb 11th, 2000, 03:54 PM
#2
Lively Member
When you talk to a webserver and ask it for a file it will return several lines of information then the actual file you asked for comes though.
Try this..
Start, Run, "telnet www.vb-world.net 80"
(Click OK)
Telnet will open and connect, when it is connected type in...
GET / HTTP/1.0
and press enter twice...
You will see something like...
HTTP/1.1 200 OK
Date: Sat, 12 Feb 2000 08:50:23 GMT
Server: Apache/1.3.9 (Unix) PHP/3.0.12
Connection: close
Content-Type: text/html
Content-Length: 18194
Thats the HTTP header, the "Content-Length" will indicate how many bytes long the file is.
If you want to know how big the file "msie5.exe" on microsoft server is you would do...
on CmdConnect_Click()
sckSocket.connect "www.microsoft.com", 80
End Sub
on SckSocket_Connect()
sckSocket.senddata "GET /downloads/files/ie5/msie5.exe HTTP/1.0" & vbcrlf & vbcrlf
End Sub
on SckSocket_DataArrival(bytes as long)
sckSocket.getdata TempStr, vbstring
'here is where u need to scan for "Content-Length" and trap accordingly
End Sub
------------------
Regards,
Paul Rivoli
-------------------
[email protected]
http://users.bigpond.com/privoli
-
Feb 11th, 2000, 08:57 PM
#3
Thread Starter
New Member
Thanx privoli, that´s great Wow
Thanx very much
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
|