Jump to content

Recommended Posts

Posted

Hi There,

I'm using Internet Explorer UDF to upload a file.

The test HTML form just contains an input tag and a submit button.

<input type="file" id="file1" name="datafile" size="40">

<input type="submit" id="submit1" value="Send">

The autoit script gets the form and can submit, but can't update the input type "file". When I run the script below it reports that no file was uploaded even though the file exists on my computer.

Many Thx in advance!

Autoit Code Snippet

$oIE = _IECreate()

_IENavigate($oIE, "http://localhost/test.html")

$o_form = _IEFormGetObjByName($oIE, "Form") ; new page needs to get form again

$o_file = _IEFormElementGetObjByName($o_form, "file1")

_IEFormElementSetValue($o_file, "C:\test.csv")

$oButtonsubmit = _IEFormElementGetObjByName($o_form, "submit1")

$oButtonsubmit.click

_IELoadWait($oIE)

Posted (edited)

<input type="file" id="file1" name="datafile" size="40">

$o_file = _IEFormElementGetObjByName($o_form, "file1")

See where I think the problem may be?

edit: but it works for the submit button, so I'm probably wrong..

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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