Vindicator209 Posted November 20, 2007 Share Posted November 20, 2007 (edited) My head is about to EXPLODE because I can't figure out how to set the data in this browse input, I believe using _IEFormGetCollection() and _IEFormElementGetCollection() will do the trick but I truthfully don't have much experience using it... I'm trying to set the browse element to a file name.Example : "c:\file\file.zip"Here is the form<form enctype="multipart/form-data" action="" method="POST" onsubmit="set_pleasewait()"> <input type="HIDDEN" name="MAX_FILE_SIZE" value="10240000"> <input type="FILE" name="scanfile" value="Browse..."> <input type="HIDDEN" name="action" value="process"> <input type="SUBMIT" id="submitbutton" value="Submit" disabled> <a href="http://virusscan.jotti.org/de" title="Auf Deutsch"><img src="images/de.png" border="0" alt=""></a> </form>From http://virusscan.jotti.org/I so far have this:_IENavigate($oIE,"http://virusscan.jotti.org/") $oForm = _IEFormGetCollection ($oIE, 0) $oFile = _IEFormElementGetObjByName ($oForm, "scanfile") _IEFormElementSetValue ($oFile, "c:\file\file.zip" )ThanksP.S. I'll thank you in the morning, im tired atm. Thanks though Edited November 20, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Generator Posted November 20, 2007 Share Posted November 20, 2007 (edited) Apparently--> IE.au3 V2.3-1 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType (Browser securuty prevents SetValue of TYPE=FILE)A work around..see if it works_IEAction($oFile, "focus")Send("C:\file\file.zip") Edited November 20, 2007 by Generator Link to comment Share on other sites More sharing options...
DaleHohm Posted November 20, 2007 Share Posted November 20, 2007 Please read the information in the helpfile about _IEFormElementSetValue (particularly the Remarks). Also look at the output in the SciTe console -- it should lead you to the answer. 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 Link to comment Share on other sites More sharing options...
Vindicator209 Posted November 20, 2007 Author Share Posted November 20, 2007 Thanks DaleHolm, I hadn't seen that, I used this: $oIE2 = _IECreate("http://virusscan.jotti.org/",0,0) $oForm = _IEFormGetCollection ($oIE2, 0) $oFile = _IEFormElementGetObjByName ($oForm, "scanfile") _IEAction($oFile, "focus") $hIE = _IEPropertyGet($oIE2, "hwnd") ControlSend($hIE, "", "Internet Explorer_Server1", GUICtrlRead($FilePath)) [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
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