Note that there are some explanatory texts on larger screens.

plurals
  1. POFile Upload Warning post content-length of bytes exceeds the limit
    text
    copied!<p>I am making a file upload system. The user chooses where to upload using the dynamic drop down list. And this is the problem I am facing right now. This is my form. </p> <pre><code>&lt;form action="uploader.php" method="POST" enctype="multipart/form-data" name="uploads"&gt; &lt;label for="file"&gt;Choose a file: &lt;/label&gt; &lt;input type="file" name="userfile" id="userfile"&gt;&lt;br/&gt;&lt;br/&gt; &lt;select id="text-one" name="one"&gt; &lt;option selected value="base"&gt;Select Department&lt;/option&gt; &lt;option value="CSE" name="cse"&gt;Computer Science Engineering&lt;/option&gt; &lt;option value="ECE" name="ece"&gt;Electronics &amp; Communication Engineering&lt;/option&gt; &lt;option value="MECH" name="mech"&gt;Mechanical Engineering&lt;/option&gt; &lt;/select&gt; &lt;br /&gt;&lt;br/&gt; &lt;select id="text-two" name="two"&gt; &lt;option&gt;Select Semester&lt;/option&gt; &lt;/select&gt; &lt;br /&gt;&lt;br/&gt; &lt;select id="text-three" name="three"&gt; &lt;option&gt;Select Subject&lt;/option&gt; &lt;/select&gt; &lt;br/&gt;&lt;br/&gt; &lt;button class ="btn btn-primary" button type="submit" name="upload" value="Upload" onClick="val()"&gt;Upload&lt;/button&gt; &lt;/form&gt; </code></pre> <p>And this is my other php file to which it is linked. </p> <pre><code>&lt;?php if(isset($_POST['upload'])) { $path1=$_POST['one']."/"; $path2=$_POST['two']."/"; $path3=$_POST['three']."/"; $upload_path=$path1.$path2.$path3; } else { echo "Select a Subject"; echo "&lt;br&gt;"; } $allowed_filetypes = array('.doc','.docx','.jpg','.jpeg','.png','.ppt','.pptx','.xls','.xlsx','.pdf','.txt','.zip','.rar'); $max_filesize = 20000000; $filename = $_FILES['userfile']['name']; $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); if(!in_array($ext,$allowed_filetypes)) die("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.alert('You cannot upload the following type of file!') window.location.href='upload.php'; &lt;/SCRIPT&gt;"); if(filesize($_FILES['userfile']['size']) &gt; $max_filesize) die("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.alert('The file you attempted to upload is too large!') window.location.href='upload.php'; &lt;/SCRIPT&gt;"); if(!is_writable($upload_path)) die("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.alert('You cannot upload to the specified directory!') window.location.href='upload.php'; &lt;/SCRIPT&gt;"); if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)) echo ("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.alert('Your file has been uploaded successfully') window.location.href='upload.php'; &lt;/SCRIPT&gt;"); else echo ("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.alert('There was an error during the file upload!') window.location.href='upload.php'; &lt;/SCRIPT&gt;"); ?&gt; </code></pre> <p>I have edited the phpini file with the following settings and also made a .htaccess file in the php folder. </p> <p>upload_max_filesize 25M post_max_size 25M memory_limit 64M</p> <p>But when I intentionally upload a file greater than 25 MB, I get the error as given in the title. Also, considering the max file size is being violated, it does not give the error related to the file size, i.e The file you attempted to upload is too large, it says You cannot upload the following type of file. And in the background that post length warning thing comes. </p> <p>Please help me with this. I am on my localhost. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload