Jump to content

Check if file exist before download


Recommended Posts

With this forums help I've been able to develop a software updater for our beta testers, I need to check whether a file exist on the web before I initiate a download and delete the original exe.

Example:

1. Run the updater. - (done)(lol)

2. Check if new .exe exist on the website (http not ftp)- (not done)

3. If YES, then delete original existing .exe - (somewhat done)

4. Download File and exit (Done)

Thanks guys

Link to comment
Share on other sites

I can tell you that, you probably have already done it.

Think about how you download the file, you know how to do that you say.

Look at the functions you are using and their return and @error values.

If you are having problems then upload some example of what you have tried.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

You can try

; existing file
Local $_InetGetSize = InetGetSize ( "http://www.autoitscript.com/autoit3/files/beta/update.dat", 3 )
ConsoleWrite ( "@error : " & @error & " $_InetGetSize : " & $_InetGetSize & @Crlf )

; not existing file
Local $_InetGetSize = InetGetSize ( "http://www.autoitscript.com/autoit3/files/beta/update9999.dat", 3 )
ConsoleWrite ( "@error : " & @error & " $_InetGetSize : " & $_InetGetSize & @Crlf )

If no file size or you get different size of new exe file, you can update !

Or you send an update.dat with your upload file, like that, the next time you can use InetRead for more file details...

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...