DCCD Posted March 21, 2009 Posted March 21, 2009 Hi, here's my code, But Is there any other way Like "FileExists"? $qq = InetGetSize("http://sites.google.com/site/carshoppage/javascript/archive.zip") If $qq = 22 Then MsgBox(4096, "archive.zip", "Exists.................") Else MsgBox(4096, "archive.zip", "Not Exists.................") EndIf [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
dantay9 Posted March 21, 2009 Posted March 21, 2009 You can do Inetget for the download site and do something depending on the return value.
DCCD Posted March 21, 2009 Author Posted March 21, 2009 All i need Check if a file exists on internet ,Is there any short code? [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
Spiff59 Posted March 21, 2009 Posted March 21, 2009 (edited) If (InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")) Then Msgbox(1,"","File Exists") That's what I've seen decided upon in other threads, your example seems to be the way to go. Edit: Had I looked closer at your example, I wouldn't have bothered replying. You have it right already, and what could be simpler? Edited March 21, 2009 by Spiff59
Authenticity Posted March 21, 2009 Posted March 21, 2009 You mean other way like faster? or shorter? #include <INet.au3> Dim $sRet = _INetGetSource("http://sites.google.com/site/carshoppage/javascript/archive.zip") If StringLeft($sRet, 2) == "PK" Then ConsoleWrite("File found" & @LF) Else ConsoleWrite("File not found" & @LF) EndIf Return the PK{version} header of the ZIP file or the first dword in short.
DCCD Posted March 21, 2009 Author Posted March 21, 2009 You mean other way like faster? or shorter?I mean short [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
Authenticity Posted March 21, 2009 Posted March 21, 2009 Lol, I see a much shorter way ;] #include <INet.au3> Dim $sURL = "http://sites.google.com/site/carshoppage/javascript/archive.zip" If StringLeft(_INetGetSource($sURL), 2) == "PK" Then ... Take into consideration that "PK" is just for ZIP files, it may be "MZ" for EXE etc...
DCCD Posted March 21, 2009 Author Posted March 21, 2009 Thanks a lot everyone [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
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