If you hide a form in an onclick handler, the attached file is never actually posted to the server :( <div id="test"> <form target="iframe" enctype="multipart/form-data" method="post" action="/upload_file"> <input type="file" /> <input type="submit" onclick="document.getElementById('test').style.display='none'" /> </form> </div>
See also: bug 5196