Jump to content

Recommended Posts

Posted

Hey all,

 

So I have a popup, where I need to add an attachment (not email), but it just doesn't work.

I tried with this:

WinWaitActive("File Upload") 
Send("C:\file.txt") 
Send("{ENTER}")

but no luck.

And this is the part of the form code:

<input name="attachments" multiple="" type="file">

Help, pls:)

Posted

@bostjan35

You could use _IE* functions to set the value of the input box.

Just create the IE object, navigate to the webpage, get the collection of the input boxes, and loop through them looking for the name "attachments"; once you found it, set the filename to the .Value property of the input box and you should be done :)

There are a tons of examples both on the Help file and on the Forums :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Posted

Hey,

 

Thanks for swift reply:)

Well, I tried this with what little I know, but it says "variable used without being declared".

$colTags = _IETagNameGetCollection($oForm, "input")
For $oTag In $colTags

  If $oTag.value = "attachments"  Then

  _IEAction($oTag, "click")
    EndIf
Next

WinWaitActive("File Upload") 
Send("C:\test.txt")  
Send("{ENTER}")

Help :)

Posted

Try accessing the object by name like :

Local $oInput = _IEGetObjByName ($oForm, "attachments")

For the rest of the code, I don't understand what are your intents.  Give a larger part of the DOM, and explain in more details your objectives.  Like what kind of window is "File Upload", where does it come from, etc.  Invest your time in giving us the appropriate informations so we can help you effectively.

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
×
×
  • Create New...