Upload Image to file field in Chrome

Does anybody have a macro or any ideas for how one would automatically pass along a file to a file upload selector in a form in either Chrome or Safari?

I would like to avoid if possible trying to figure out how to do an auto drag and drop onto it to do the actual upload.

Thank you!

I suspect the only way will be via UI control (click the button, control the file selector using Command-Shift-G and type-ahead and returns).

The reason is that it is probably seen as a security violation to allow JavaScript within the page to set the file selector.