Jump to content



Photo

Internet Explorer input file problem


  • Please log in to reply
2 replies to this topic

#1 pickypiglet

pickypiglet

    Seeker

  • Active Members
  • 6 posts

Posted 12 May 2012 - 09:24 PM

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)





#2 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,380 posts

Posted 12 May 2012 - 09:40 PM

<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, 12 May 2012 - 09:42 PM.

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

#3 pickypiglet

pickypiglet

    Seeker

  • Active Members
  • 6 posts

Posted 12 May 2012 - 09:57 PM

Hi,

It still doesn't work.
I've tried with both name and id.

Thx.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users