Jump to content

How to script file upload button


Recommended Posts

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

Hi guys, our company's website has this button for uploading multiple images. How can I create a script that automatically selects the images then uploads them? I already know the path of each images. I just don't want to script a click on the file upload button since I get a headache trying to make that work. My current goal is to script it with something like:

$files1 = "C:TeamBuildingTeam Games.jpg"

$files2 = "C:TeamBuildingTeam Prayer.jpg"

$oIE.getelementbyid("file").upload $files1, $files2

 

Then after the image upload the form is submitted. Obviously the code above is a fantasy :D I just need the part to script uploading the images instead of clicking the upload button. My Autoit script will modify the innerHTML of this form to add the script for auto-upload. Is this doable? 

Edited by Wolfiesaxah
Link to comment
Share on other sites

_ieaction(,"click") the 'upload' button...it'll open an upload window.  Grab the edit for the file path/name, ControlSetText, click the upload button on the window.

If you use my signature to grab the edit, the xpath would be:

$xpath = "//input[@name='file']"
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...