LOULOU Posted August 19, 2005 Posted August 19, 2005 Example : I want to put this data "c:\toto\toto.txt" in an html input type="file' How can i do with automation. Thanks in advance
DaleHohm Posted August 19, 2005 Posted August 19, 2005 Unfortunately, I can think of quite a few very different ways to interpret your question. Please be more explicit in your description and let me know anything you've already tried. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
LOULOU Posted August 19, 2005 Author Posted August 19, 2005 (edited) Unfortunately, I can think of quite a few very different ways to interpret your question.Please be more explicit in your description and let me know anything you've already tried.Dale<{POST_SNAPBACK}><input name= "toto" type="file">I want to put directly the location and name of the file with automation without typing it in the input.I try with _IEFormElementSetValue($fichier1,"C:\Documents and Settings\Patrick\Bureau\dpsi.xlt") and nothing happen neither an error Edited August 19, 2005 by LOULOU
DaleHohm Posted August 19, 2005 Posted August 19, 2005 Oddly, this appears to be a limitation of the "input type=file" element. I found a comment that "While the [value] property accepts new value assignments in some browsers, only values assigned as a result of a user's explicit file menu choice get submitted." It does not appear that IE will even accept a value assignment programatically. The best I can come up with at the moment is to focus on the element and use AutoIt Send:#include <IE.au3> ; Create a browser and HTML on the fly... $oIE = _IECreate() _IEBodyWriteHTML($oIE, "<form action='bogus.html' name='myform'><input name='toto' type='file'><input name='Submit' type='submit'></form>") $oFrom = _IEFormGetObjByName($oIE, "myform") $oInput = _IEFormElementGetObjByName($oFrom, "toto") $oInput.focus Send("C:\file.txt")<input name= "toto" type="file">I want to put directly the location and name of the file with automation without typing it in the input.I try with _IEFormElementSetValue($fichier1,"C:\Documents and Settings\Patrick\Bureau\dpsi.xlt") and nothing happen neither an error<{POST_SNAPBACK}> Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
LOULOU Posted August 19, 2005 Author Posted August 19, 2005 Oddly, this appears to be a limitation of the "input type=file" element. I found a comment that "While the [value] property accepts new value assignments in some browsers, only values assigned as a result of a user's explicit file menu choice get submitted." It does not appear that IE will even accept a value assignment programatically. The best I can come up with at the moment is to focus on the element and use AutoIt Send:#include <IE.au3> ; Create a browser and HTML on the fly... $oIE = _IECreate() _IEBodyWriteHTML($oIE, "<form action='bogus.html' name='myform'><input name='toto' type='file'><input name='Submit' type='submit'></form>") $oFrom = _IEFormGetObjByName($oIE, "myform") $oInput = _IEFormElementGetObjByName($oFrom, "toto") $oInput.focus Send("C:\file.txt")<{POST_SNAPBACK}>Thanks i will try it tomorow.
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