AcidCorps Posted June 5, 2007 Posted June 5, 2007 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?
ResNullius Posted June 5, 2007 Posted June 5, 2007 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.
James Posted June 5, 2007 Posted June 5, 2007 Look in the helpfile for: InetGet() @error FileExists Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
AcidCorps Posted June 5, 2007 Author Posted June 5, 2007 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now