Jump to content

Dificult question. How can I dounload a file from a site, when i dont know the full name of the file?


sosimple
 Share

Recommended Posts

I want to download a file. I use a program wget.exe because the site has a redirection protection . The script is this

RunWait(@ComSpec & ' /c wget -P D:\temp --referer=http://www.***.com http://www.***.com/download/myfile.1.2.rar', ""

and is work fine. The file myfile.1.2.rar saved to folder D:\temp The problem is that the name of the file is not the same. After a while it must be myfile.1.3.rar then myfile.1.4.rar etc. What I know is that it will always start with the name myfile How can i read somehow what is the exact name of the file every time so that to use variables to the above script to download the right file? On the site will always be only one file starting with the name myfile (The older deleted) . I think is very dificult but if anyone have a solution...

Thanks ,

Link to comment
Share on other sites

You know with a high degree of confidence what the file will be named, and you know when the name changes.

To check for updates:

if the current version doesn't exist then

       do

                  $new_version = add 1 to version number

                  $found_new_version = Get($new_version)

                  

       until found_new_version

       download $new_version

       $current_version = $new_version

endif

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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...