Wolfiesaxah Posted March 25, 2015 Share Posted March 25, 2015 (edited) <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 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 March 25, 2015 by Wolfiesaxah Link to comment Share on other sites More sharing options...
jdelaney Posted March 25, 2015 Share Posted March 25, 2015 (edited) _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 March 25, 2015 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 More sharing options...
Wolfiesaxah Posted March 26, 2015 Author Share Posted March 26, 2015 No known script to achieve this automatically? Link to comment Share on other sites More sharing options...
jdelaney Posted March 26, 2015 Share Posted March 26, 2015 I'll help you adjust a script you attempt to write, but I'm not going to dig through the forum to help you. 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 More sharing options...
Wolfiesaxah Posted March 26, 2015 Author Share Posted March 26, 2015 I have digged through the forums and your signature, learned a lot of cool stuffs This one however, I don't even know where to start, no articles regarding programing file upload, there are some from ASP but don't wan't it in ASP Link to comment Share on other sites More sharing options...
Wolfiesaxah Posted March 27, 2015 Author Share Posted March 27, 2015 Hi Jdelaney, how do I get or script a click on the upload button? I do not know the ID of that button. Or do instead do a sendkey for ENTER? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now