POST maximum limit

1

I'm trying to make a video upload form but I'm having a problem that makes uploading impossible since I always get the following error:

Warning: POST Content-Length of 69509336 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

Even changing php.ini so posts have no limits

post_max_size=0

What can I do to resolve this problem?

 <form action="" method="POST" enctype="multipart/form-data">
            <input type="file" name="file" />
            <input type="submit"/>
        </form>

        <?php

            $randomNum=substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyz"), 0, 11);
            $randomNum64 = base64_encode($randomNum);
            $base64 = base64_encode($randomNum);



           if(isset($_FILES['file'])){
               $errors= array();
               $file_name = $_FILES['file']['name'];
               $file_size =$_FILES['file']['size'];
               $file_tmp =$_FILES['file']['tmp_name'];
               $file_type=$_FILES['file']['type'];
               $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));


               if(empty($errors)==true){
                   move_uploaded_file($file_tmp,"uploads/".$file_name);
                   echo "Success";
               }else{
                   print_r($errors);
               }
           }

        ?>
    
asked by anonymous 08.11.2017 / 23:32

2 answers

1

It is not good practice to leave unlimited, especially if it is opened, maaaaas ... Try this:

  post_max_size = 2M para
  post_max_size 100M
  upload_max_filesize = 8M para
  upload_max_filesize = 100M
    
08.11.2017 / 23:44
1

This is a server limitation, if it is to php.ini and searching for post_max_size you can check what size limit you have to pass data through POST.

You can access this information via the browser.

Create a php file and publish it

 <?php

   phpinfo(); 

 ?>

Once the change is made, restart the server to take effect.

  

A tip that might be useful: Em alguns casos, você precisará aumentar o tempo máximo de execução.

    
08.11.2017 / 23:43