Jump to content
Sign in to follow this  
AcidCorps

Check Internet file exist

Recommended Posts

AcidCorps

How could I check if an internet file exist (or if the file has been deleted from the server)

I've messed around file fileexists but couldn't get it to work, I tried

$size = InetGetSize("blah.com/file.exe")

If $size = 0 Then MsgBox("blah","blah")

anyone know how to do this?

Share this post


Link to post
Share on other sites
ResNullius

Taking the example straight from the help file, this works for me:

$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")
MsgBox(0, "Size of remote file:", $size)
$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/I_don't_exist.txt")
MsgBox(0, "Size of remote file:", $size)
is wrong, you need a flag as the first parameter.

Share this post


Link to post
Share on other sites
AcidCorps

Taking the example straight from the help file, this works for me:

$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")
MsgBox(0, "Size of remote file:", $size)
$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/I_don't_exist.txt")
MsgBox(0, "Size of remote file:", $size)oÝ÷ Ûú®¢×§¢×±iËeËZ´²Z()à~ۺثyØ­¢ëp«HÁ«%¢"诬¶¬jëh×6
$size = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/I_don't_exist.txt")
if $size = "0" then MsgBox(0, "Does Not Exist" , "File Does Not Exist")
if $size <> "0" then msgbox(0, "Does Exist" , "File Does Exist")oÝ÷ Ú«¨µéÚ
is wrong, you need a flag as the first parameter.
no I was just typing really fast when I made this post and left that out on accident

Share this post


Link to post
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
Sign in to follow this  

×