Jump to content

InetGetSize() question.


Recommended Posts

Hiya,

I am not going to be able to test InetGetSize() for a while, but do not want to interrupt coding too much so I thought I'd ask on here.

I want to check the size of a file located on a webserver using the following code:

Global $Size
Global $url = "www.... yadda yadda.../something.html"

$Size = InetGetSize($url)

If $Size<> (my target size in bytes) Then
    Msgbox(4096, "Error!", "Filesize is incorrect or missing... yadda...")
    Exit
EndIf

Basically I want to use this as a control for running one of my scripts. So I want to get the size of the remote file so someone can use the program. When I want that someone to no longer be able to use the program, I will remove or change the filesize of my target file. I believe this will work. Does it actually download this file to get its size or does it get the size without download?

Thanks for any help!

Link to comment
Share on other sites

It doesn't download to get the file size.

Try getting the file size on a multi-megabyte file while on dialup and you will agree!

One issue: If you don't have a live connection, but have RAS set for autodial, and the RAS screen is stuck waiting for a password or line connection, the AutoIT script stops indefinitely until the RAS screen is actioned - I'm not sure if this is a Windows issue or one with AutoIT.

Link to comment
Share on other sites

multi-megabyte file

Nah, our recent hack-attack competition is a very good example.

(File size of approx. 1.5GB if i remember correctly)

#)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...