PcExpert Posted May 23, 2006 Share Posted May 23, 2006 Hello, Is it possible to check if a remote file exists? Thanks, PcExpert Link to comment Share on other sites More sharing options...
ChrisL Posted May 23, 2006 Share Posted May 23, 2006 Hello,Is it possible to check if a remote file exists?Thanks,PcExpertAs in where?A local network share, on the internet? [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Don N Posted May 23, 2006 Share Posted May 23, 2006 #include <file.au3> ;the file you want to search for $find = "test.txt" ;where E: is the remote drive you want to check $rDrive = DriveMapGet("E:") & "\" ;change the working directory FileChangeDir( $rDrive ) ;get the first file $search = FileFindFirstFile( "*.*" ) If $search = -1 Then MsgBox( 0, "ERROR!", "There are no files or could not connect to remote directory" ) EndIf While 1 $file = FileFindNextFile( $search ) If @error Then MsgBox( 0, "Failure", "The file was not found in the remote directory" ) ExitLoop EndIf If $file = $find Then MsgBox( 0, "Success", "The file exists in the remote directory " & $rDrive ) EndLoop EndIf WEnd FileClose( $search ) Hope that helps... _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
PcExpert Posted May 23, 2006 Author Share Posted May 23, 2006 oow, sorry that I didn't told that. I want to check if a file exists in the internet for example: I want to check if www.mytestwebsite.com/mytestscript.au3. Thanks, PcExpert Link to comment Share on other sites More sharing options...
ChrisL Posted May 24, 2006 Share Posted May 24, 2006 Either of these should be able to tell you, what I would say is that if the webhost displays a html "file not found" page then inetget will download this page, so I suggest you open the file and check a line of text within the file to ensure it isn't a HTML "file not found" page you just downloaded Downloads a file from the internet using the http or ftp protocol. InetGet ( "URL" [,"filename" [, reload [, background]]] ) Returns the size (in bytes) of a file located on the internet. InetGetSize ( "URL" ) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
PcExpert Posted May 24, 2006 Author Share Posted May 24, 2006 (edited) It's an exe file on my own home FTP Server. after the minute it returns the filesize Edited May 24, 2006 by PcExpert Link to comment Share on other sites More sharing options...
Don N Posted May 24, 2006 Share Posted May 24, 2006 If its on ur home ftp server can't you jsut run a script on the server and have it email you the size. Or map a network drive to the drive running the ftp server and run the script posted above? _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
BigDod Posted May 24, 2006 Share Posted May 24, 2006 Try this $size = InetGetSize("http://www.comp-sos.co.uk/download/test.exe") if $size = 0 Then MsgBox(0, "", "File does not exist") EndIf Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother 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