Jump to content

Recommended Posts

Posted

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

Posted (edited)

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
Posted

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.

If you look in the IE.au3 every "function" on the com-objects are Javascript-functions, so I think this is blocked by the IE.

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
  • Recently Browsing   0 members

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