SLIpros Posted August 28, 2009 Share Posted August 28, 2009 (edited) Hey, whant to do a simple file uploaderI search at forum, read help file, and stil can't fix it.#include <IE.au3> $oIE = _IECreate("http://www.multiupload.com/", 1, 1) _IELoadWait ($oIE) ;*********************************************************************** $oSubmit = _IEGetObjByName ($oIE, "file_0") _IEAction ($oSubmit, "Click") $oSubmit = _IEGetObjByName ($oIE, "description_0") _IEFormElementSetValue ($oSubmit, "nothing")In this step i have a problem.How script can click on Upload button ( java script )This is button code: <INPUT style="BORDER-BOTTOM: #b0b8bb 1px solid; BORDER-LEFT: #b0b8bb 1px solid; WIDTH: 81px; HEIGHT: 21px; MARGIN-LEFT: 2px; BORDER-TOP: #b0b8bb 1px solid; BORDER-RIGHT: #b0b8bb 1px solid" onclick=startupload(); value=Upload type=button>And this is java script: function startupload() { if (document.getElementById('file_0').value == '') { alert('Please select a file to upload.'); } else if ((document.getElementById('fromemail').value !== '') && (checkMail(document.getElementById('fromemail').value))) { document.getElementById('fromemail').focus(); alert('Please enter a valid sender e-mail address.'); } else if ((document.getElementById('toemail').value !== '') && (checkMail(document.getElementById('toemail').value))) { document.getElementById('toemail').focus(); alert('Please enter a valid recipient e-mail address.'); } else { document.getElementById('uploadfrm').submit(); document.getElementById('uploadwindow').style.display='none'; document.getElementById('deliveryemail').style.display='none'; document.getElementById('uploadprogress').style.display=''; document.uploading=true; document.getElementById('midgrad').style.backgroundImage = "url('images/mid_bg_no_grad.gif')"; document.getElementById('midgrad').height = '47'; document.getElementById('deliveryemail').style.display='none'; document.maxheight=552; resizemulti(); setTimeout("startprogress()",2000); }Thank you for your replys. Edited August 28, 2009 by SLIpros Link to comment Share on other sites More sharing options...
DaleHohm Posted August 28, 2009 Share Posted August 28, 2009 I presume your frustration is that the button has no name or ID. Take a look at _IETagnameGetCollection for _IEFormElementGetCollection and use an index parameter to get the element you want. 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...
SLIpros Posted August 28, 2009 Author Share Posted August 28, 2009 (edited) I presume your frustration is that the button has no name or ID. Take a look at _IETagnameGetCollection for _IEFormElementGetCollection and use an index parameter to get the element you want.DaleThank you! it's really helps +) Edited August 28, 2009 by SLIpros Link to comment Share on other sites More sharing options...
SLIpros Posted August 28, 2009 Author Share Posted August 28, 2009 (edited) ControlSend ( "", "", "", "D:\music.zip" )it's always write me d;\music.zip. how can i do double dots?If i try with Send, then all ok Edited August 28, 2009 by SLIpros Link to comment Share on other sites More sharing options...
DaleHohm Posted August 29, 2009 Share Posted August 29, 2009 Not sure... try raw? ControlSend ( "", "", "", "D:\music.zip", 1) 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...
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