JavaScript with onchange
event:
<form action="upload.php" method="post" enctype="multipart/form-data">_x000D_
<input type="file" name="filename" onchange="javascript:this.form.submit();">_x000D_
</form>
_x000D_
jQuery
.change()
and .submit()
:
$('#fileInput').change(function() {_x000D_
$('#myForm').submit();_x000D_
});
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>_x000D_
<form action="upload.php" id="myForm">_x000D_
<input type="file" id="fileInput">_x000D_
</form>
_x000D_