With a .php file of the following content
<!DOCTYPE html>
<html lang="en">
<body>
<?php
$filename="";
if($_SERVER['REQUEST_METHOD'] == 'POST') {
echo "isset post submit: " .(isset($_POST['submit'])?"true":"false");
if(isset($_POST['submit']))
{
$filename=$_FILES["local_med"]["name"];
echo "<p>file: " .$filename;
}
} // POST
?>
<h1>Upload File</h1>
<form method="POST" enctype="multipart/form-data" >
<input type="file" id="local_med" name="local_med" required="true"
accept="image/png, video/mp4"/>
<br>
<button type="submit" name="submit"> Submit </button>
</form>
</body>
</html>
If I select a .png file and click on the Submit button, I get output
isset post submit: true
file: age.png
However, if a .mp4 file is selected instead, I get output
isset post submit: false
What could the mistake be?
Update: tried to use Developer's tool to check payload. However, the tab is not there.