Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Upload Form - can't upload 200kb image file
    text
    copied!<p>I have a form to upload 2 files. They can upload one, or just upload both at the same time. When I upload 2 small image files (both under 100kb), they work perfect. But if one file is larger, say around 200kb, it doesn't work. I already set the max value to "100000" in the hidden tag below, so I'm not sure what else I can do to fix this?</p> <pre><code>&lt;form enctype="multipart/form-data" action="upload.php" method="post"&gt; &lt;b&gt;Image File&lt;/b&gt;&lt;br /&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="100000" /&gt; &lt;b&gt;Large Image&lt;/b&gt;: &lt;input type="file" name="uploadedfile1" size="30" /&gt;&lt;br /&gt; &lt;b&gt;Thumb Image&lt;/b&gt;: &lt;input type="file" name="uploadedfile2" size="30" /&gt;&lt;br /&gt; &lt;center&gt;&lt;input type="submit" name="submit" value="submit" class="button"&gt;&lt;/center&gt; &lt;/form&gt; </code></pre> <p>When it's processed, it goes to this php code:</p> <pre><code>$uploadedfileBase1 = basename($_FILES['uploadedfile1']['name']); $uploadedfileTemp1 = $_FILES['uploadedfile1']['tmp_name']; $uploadedfileBase2 = basename($_FILES['uploadedfile2']['name']); $uploadedfileTemp2 = $_FILES['uploadedfile2']['tmp_name']; // Large Image $target_path_large = $target_path . "large/" . $uploadedfileBase1; if(move_uploaded_file($uploadedfileTemp1, $target_path_large)) { echo "&lt;p&gt;The &lt;b&gt;large&lt;/b&gt; file \"$uploadedfileBase1\" has been uploaded.&lt;/p&gt;"; } else{ echo "&lt;p&gt;There was an error uploading the &lt;b&gt;large&lt;/b&gt; file &lt;i&gt;$uploadedfileBase1&lt;/i&gt;, please try again!&lt;/p&gt;"; } // Thumb Image $target_path_thumb = $target_path . "thumbs/" . $uploadedfileBase2; if(move_uploaded_file($uploadedfileTemp2, $target_path_thumb)) { echo "&lt;p&gt;The &lt;b&gt;thumbnail&lt;/b&gt; file \"$uploadedfileBase2\" has been uploaded.&lt;/p&gt;"; } else{ echo "&lt;p&gt;There was an error uploading the &lt;b&gt;thumbnail&lt;/b&gt; file &lt;i&gt;$uploadedfileBase2&lt;/i&gt;, please try again!&lt;/p&gt;"; } </code></pre> <p>Thank you for reading!</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