Sign in to follow this  
Followers 0
Seth27

type=file

4 posts in this topic

#1 ·  Posted (edited)

I want to know, what is wrong

Autoit-Code:

$o_file = _IEFormElementGetObjByName($o_form, "userfile")
_IEFormElementSetValue ($o_file, "Hello.txt")

the source-code of the website:

<td class="inputDescription">Lokale Datei:</td>
    <td><input type="File" name="userfile"></td>

I don't know, why the program doesn't send "Hello.txt" into the field.

It is because of "type="file""?

How can I solve this problem?

Can you help me?

Thank you

Edited by Seth27

Share this post


Link to post
Share on other sites



I tried this with a complete path.

The original code is:

$o_IE = _IECreate () 
_IENavigate ($o_IE, "website")

$o_form = _IEFormGetObjByName($o_IE, "login_form")
$o_login = _IEFormElementGetObjByName($o_form, "login")
$o_password = _IEFormElementGetObjByName($o_form, "passwd")
_IEFormElementSetValue($o_login, "loginname")
_IEFormElementSetValue($o_password, "passwd")
_IEFormSubmit($o_form)

$FileList=_FileListToArray("C:\income", "*.*", 1) 
For $i = 1 To Ubound($FileList) - 1
$o_form1 = _IEFormGetObjByName($o_IE, "form1")

$o_file = _IEFormElementGetObjByName($o_form1, "userfile")
$o_name=_IEFormElementGetObjByName($o_form1, "fname")

_IEFormElementSetValue ($o_file, "C:\income\" & $FileList[$i])
_IEFormElementSetValue($o_name, $FileList[$i])

_IEFormSubmit($o_form1)
Next

The type of fname is text and the type of userfile is file. In fname it writes the name but in userfile it write nothing. I don't know if it is because of the type="file" of userfile.

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  
Followers 0