<!DOCTYPE html>
<html>
<body>
<form action="/submit_page.php" method="post" enctype="multipart/form-data">
Enter your first name and last name below :<br>
First name:
<input type="text" name="fname"><br>
Last name:
<input type="file" name="lname" ><br>
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>
Above form was for only Two input fields
- First Name
- Last Name
Now (Suppose as a hacker) i have modified last name text input field into Last name file input and also added enctype="multipart/form-data" in form attributes and i hit submit.
Its sending data along with file no matters how big it is and server is still receiving it in temp means its eating my server Performance and Bandwidth as well as Clients Bandwidth too but form was designed for only text input
So my question is how to prevent this kind of hacks ?