solid2005 Posted January 23, 2009 Share Posted January 23, 2009 If FileExists("http://XXXX.com/Files/WOW.exe") Then InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe") Else MsgBox(4096,"Installer", "Does NOT exists") EndIf how can i declare the if the file exist in the site flesExists Read on local Drive. can some one elp me Link to comment Share on other sites More sharing options...
Spiff59 Posted January 23, 2009 Share Posted January 23, 2009 (edited) Maybe use "InetGetSize" to try and retrieve the file size, if the call errors, then the file likely doesn't exist? Edited January 23, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
yucatan Posted January 23, 2009 Share Posted January 23, 2009 (edited) Maybe use "InetGetSize" to try and retrieve the file size, if the call errors, then the file likely doesn't exist? fileexist is only for local so hard drive usb key or external hdd netwerk does olso work but not http try this if InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat") <> 0 then InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe") Else MsgBox(4096,"Installer", "Does NOT exists") EndIf Edited January 23, 2009 by yucatan Link to comment Share on other sites More sharing options...
solid2005 Posted January 23, 2009 Author Share Posted January 23, 2009 If InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat") <> 0 then If FileExists("C:/Files/WOW.exe") Then exit else InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe") endif is this gonna work? im in shop im not yet go home. Link to comment Share on other sites More sharing options...
Spiff59 Posted January 25, 2009 Share Posted January 25, 2009 (edited) So, another requirement is that you don't want to download it if it's already on your C: drive? If so, I wouldn't bother banging on the internet until after you've checked that. Also, you dont need <> 0, letting it test the boolean (zero/non-zero) result is enough. If Not FileExists("C:/Files/WOW.exe") Then If InetGetSize("http://XXXX/Files/WOW.exe"") Then InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe") EndIf EndIf Edited January 25, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
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