Can someone help me, I want to get the size of a file I want to download, I don't care if it's via inet or winsock control.
i.e. get size of http://www.anysite.com/dir/file.zip
Thanks In Advance!
Printable View
Can someone help me, I want to get the size of a file I want to download, I don't care if it's via inet or winsock control.
i.e. get size of http://www.anysite.com/dir/file.zip
Thanks In Advance!
I believe a server might tell you that with an HTTP HEAD request, but I'm not sure.
I know that info comes in the http header but how do I read it?
Use the Winsock control to connect to the HTTP server and send the following text:
"HEAD /dir/file.zip HTTP/1.0" & vbcrlf & vbcrlf
Then parse the text it sends back for the file size.
Can you please give me a full code exapmle?
Here's some code that uses the winsock control. It's not that hard to use.