Jump to content
Sign in to follow this  
cypher175

IE8 - Upload Picture to Website..??

Recommended Posts

cypher175

How would I use AutoIt to upload a picture to here..?? http://img.4chan.org/b/imgboard.html

Share this post


Link to post
Share on other sites
cypher175

so there's no IE functions at all that can click the browse button on that site & then select a file..??

what would be the best way/functions to do it then..??

Share this post


Link to post
Share on other sites
cypher175

whats the best way to click the browse button to select a file for upload..??

$UpFile = _IEGetObjByName($IE, "upfile")
_IEAction($UpFile, "click")

or by forcing a mouse click on that location

or something that works better..??

Share this post


Link to post
Share on other sites
cypher175

i thought you said you couldn't use these function because IE8 security restrictions prevent using _IEFormElementSetValue..??

Share this post


Link to post
Share on other sites
jvanegmond

If you would have gone and read the example like I told you to, you would have found out that these examples provide work arounds for what you can't do with _IEFormElementSetValue.

Share this post


Link to post
Share on other sites
cypher175

i have read it before & also tried to make it work for my project too - but it never seemed to work right..

have you tried it - did it work for you on IE8..??

Share this post


Link to post
Share on other sites
jvanegmond

No, the examples don't work out of the box with IE8. They don't allow you to type in the box anymore, but like I've told you two times already: Use mouse and keyboard. There may be some custom work involved...

Share this post


Link to post
Share on other sites
DaleHohm

OK, here is an example:

#include <IE.au3>

$oIE = _IE_Example("form")
$oT = _IEGetObjById($oIE, 'fileExample')
MouseMove(_IEPropertyGet($oT, "screenx") + _IEPropertyGet($oT, "width") - 10, _
          _IEPropertyGet($oT, "screeny") + _IEPropertyGet($oT, "height")/2)
MouseClick("left")
WinWait("Choose File to Upload")
$hChoose = WinGetHandle("Choose File to Upload")
ControlSetText($hChoose, "", "Edit1", "C:\AUTOEXEC.BAT")
ControlClick($hChoose, "", "Button2")

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.