2

I am working on PHP and making a script to upload video, I have set the max file size on php.ini to 20MB but still when I select a video of size more than 5MB, the form does not even get posted while it does with file size less than 5MB.

I updated these values in php.ini

post_max_size = 20M
upload_max_filesize = 500M

And below is my form :

<?php
if(isset($_POST['submit'])) {
    echo "hello";
}

?>

<form method="post" enctype="multipart/form-data" action = "">
<input type="file" name = "file" data-max-size="100048">
<input type="submit" name = "submit">
</form>

Any help highly appreciated.

Sameeksha Kumari
  • 1,158
  • 2
  • 16
  • 21

1 Answers1

2

Try this, remove the data-max-size attribute from the file-input field and use the HTML hidden field instead:

<input type="hidden" name="MAX_FILE_SIZE" value="6000000" /> 
NaijaProgrammer
  • 2,892
  • 2
  • 24
  • 33