pickypiglet Posted May 12, 2012 Posted May 12, 2012 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)
somdcomputerguy Posted May 12, 2012 Posted May 12, 2012 (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 May 12, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
pickypiglet Posted May 12, 2012 Author Posted May 12, 2012 Hi, It still doesn't work. I've tried with both name and id. Thx.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now