Upload file without submit button

How to upload a file without the submit button

You just have to add this code snippet on the event onChange:

 

<form method="post" name="frmUpload" id="frmUpload" enctype="multipart/form-data" action="upload.php">
<input type="file" name="file" id="file" size="30" onChange="window.document.forms['frmUpload'].submit();">
</form>

 

That will sent the file choosen by the user directly to the server.