I'm trying to pass files directly to an input type="filename" control element so I don't have to manually click [browse] and search for a file. I'm not trying to bypass any type of security or anything like that, i'm just trying to "imitate" the clicking of the browse putting and selecting an image without actually having to search for the file in the BROWSE FOR FILES dialog.
I'm wanting to do this directly through javascript.
Now some of you may be wondering "why the crap are you trying to do that?" well my employer has a website that he has to upload images of daily reports to and they use the standard
<input type="hidden" name="fileInput">
He wanted me to try and make a program that just does it for him and will just auto upload the files for him and all he has to do is hit submit at the end.
Is this possible?
EDIT#
I was thinking I needed to pass it the image in raw data:image/jpeg;base64 then pass it to the control somehow?
EDIT#2
What about doing something like
javascript:(function() { document.forms[0].file.value+='" + theFile + "';})()
Edit#3
From what I been looking into I guess the only possible thing is to try and do a straight HTTP Post with a MultiPart Entity. I guess this is the only way to go about doing it and its impossible to do anything directly from Javascript itself.
Would figure that since is considered a HTML object that javascript would be able to touch it. Kinda of weird that you can't.