Sign in to follow this  
Followers 0
MadCoder

Check if file exist before download

3 posts in this topic

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0