Disabling file input field cancels upload

An interesting little "feature" I stumbled across: when the file input field of an HTML form is disabled right before a submission, that field will be empty. Some pseudo code which illustrates the setup: ... <script> function submitForm(){ var form = document.getElementById("form"); var file = document.getElementById("file"); file.disabled = true; form.submit(); } </script> <body> <form id="form"> … Continue reading Disabling file input field cancels upload