I need to read date and size of a file before I download it. Normally I use INET for downloading, but I need to read file informations only before for verify of a new file version. Is possible to do it?
Thanks in advance.
Raoul
Printable View
I need to read date and size of a file before I download it. Normally I use INET for downloading, but I need to read file informations only before for verify of a new file version. Is possible to do it?
Thanks in advance.
Raoul
I believe you need to use the HTTP HEAD command. I don't know if the Inet control supports it though.
Use the File System Object:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=125
FSO can't get the file size from a file on a Web Server.
What do you mean? If the code you are writing is on the same server as the file you are downloading, you can certainly get the size. I don't think yo can get it remotely using FSO, if that is what you mean.
If it was on the same machine there would be no need to "download" using INET.
Thanks JoshT, but I don't know HTTP HEAD command. Can you send me an example about it ?
Thanks.
HEAD /page.html HTTP/1.0
then two newlines.
It works almost exactly the same as HTTP GET, except the server only sends the HTTP headers, it doesn't send the content with them.