Jump to content

How can I auto set file path for input file in IE


Recommended Posts

Hello I'm newbie in autoit.

I have a question about how can I set file path to input file Zbrowser file to upload to website) in IE.

for input text I can use

_IEPropertySet($name,"innertext","Test")

but for input file I'can, and I try to use

_IEPropertySet($oFile,"value","D:\pic.jpg")

but It's don't work.

How can I do? :P

Link to comment
Share on other sites

If that would be possible, every script on every page can fill out an input field of this type and can try if it can download any file from your computer.

I see. That is important for Javascript, but not for IE COM in my opinion since a process is already running that has access to your hard drive.

You are right. :P

In the help file see _IEFormElementSetValue

it shows this example:

; *******************************************************
; Example 4 - Set the value of an INPUT TYPE=FILE element
;               (security restrictions prevent using _IEFormElementSetValue)
; *******************************************************
;
#include <IE.au3>

$oIE = _IE_Example("form")
$oForm = _IEFormGetObjByName($oIE, "ExampleForm")
$oInputFile = _IEFormElementGetObjByName($oForm, "fileExample")

; Assign input focus to the field and then send the text string
_IEAction($oInputFile, "focus")
Send("C:\myfile.txt")
Edited by Manadar
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...