Jump to content

URLDownloadToFile with Form Login

Recommended Posts

Do you mean pop up a web form, have them sign in with it and then download a file?


I'd like to have the script be completely automatic. It would login using the form/post method, and retrieve the contents of the page that requires authentication. I wish I could share the page, but it is a proprietary trouble ticket tracking system used by my company.

basically, I want to make a front-end to this page so I can receive notifications beyond what email can bring.

I might have to use VB, but I am trying to avoid this at all costs.

Link to post
Share on other sites

You might be successful if you login using to your page using the internet explorer (URLDownloadToFile is using the internet explorer) and then try to download your file. But if the website doesn't use standard authentication mechanisms there's no other way than to use a browser to login and let it download the file afterwards.

Link to post
Share on other sites

You will have to "view source" on the login page. This is a long process, but it will give the results you need:

Go to the login page. Since I don't have your page, I will use google.com as an example.

Click on View menu -> Source. This will bring up notepad.

Search for <form

After form you will see action=(something) On google it is action="/search"

Here's the tricky part. You will have to search all <input fields after that to see which one is the one to use. I will not give you any more info on this.

When you find the right input, there will be a name=(something) That is the input field's identifier. On google it is name=q

You then add the page url, action and parameters in this manner:

http://www.google.com/search?q={whatever you are searching for}

If you have further input fields than one, you will add the following to that:

&{input name}={input value}

Then you can urldownloadtofile that page. For instance on google, if I wanted to download a search page for "cooking" then it would be


I have given you the answer, but you will have to figure out the rest by yourself. I would recommend looking up info on HTML.

Edited by this-is-me
Who else would I be?
Link to post
Share on other sites

I see no simple way to do this in AutoIt. Go VB or otherwise.

However instead of filling out forms you could simply make it a PHP page which redirects to the actual file. The script generates a random string from the current time and adds it onto the query (UNIX timestamp?).


The script then checks to see if the current time is a match and if so, voila.

Just suggesting ideas, I don't know exactly what your doing.

Edited by darknuke
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...