I use the jquery iframe plugin to squirt HTML into my iframe. Amongst other things, it contains:
<form id="update" action="dummy" method="POST" enctype="multipart/form-data">
<div><input type="file" name="data" id="update_data"></div>
</form>
Then I run the following function. Watching the fun in the Chrome debugger, I can see that I am successfully latching onto the frame, form, and input field. But the picker does not pop up, and the form does not submit to the (JAX-RS) service.
function update_file(file) {
var iframe = $('#new_file_iframe');
var delform = iframe.contents().find("#update");
var fileinput = iframe.contents().find("#update_data");
// URLencoding?
delform.attr("action", "/rex-ws/service/jape/update-file/" + file);
fileinput.click();
delform.submit();
}
Perhaps click
is not the right thing to set it off?