How to fix error “invalid content type: application/x-www-form-urlencoded” while uploading file in a html form?
We can get this invalid content type error while uploading a file through a html form. Actually an form attribute ‘enctype’ is needed to add in form tag for file upload. Check the below code example for understanding how to write enctype.
<form action="test.php" method="post" enctype="multipart/form-data">
<input type="file" name="fileName">
</form>