1
       <form action="uploads.php" enctype="multipart/form-data" method="post">
          <?php
          if(!empty($message)){
             echo "<p>{$message}</p>";
          }
          ?>
          <input type="hidden" name="MAX_FILE_SIZE" value="1048576" />
          <label for="something">Please, upload your file</label>
          <input type="file" name = "file_upload" id="something"/>

          <input type="submit" name="submit" value="Upload" />

       </form>
    </body>
</html>

I changed post_max_size = 100M, max_file_size was already 64M. Problem is when I run the code and upload more than 20kb then first time it gives error no. 3 (partial upload problem) and then stop working. I have to restart php to do other thing. Please help..

  • How much has upload_max_filesize? – progsource Apr 13 '15 at 17:38
  • upload_max_filesize = 64M – imrul kaish Apr 13 '15 at 18:12
  • Are you changing these settings within the code or on the server? I ran into this problem before and had to make these changes both on the server itself and within code (Wordpress has file size limits included in the package if you're using that). – leigero Apr 13 '15 at 18:38
  • I changed these settings in php.ini file. I am working on localhost. I am not using wordpress just simple php upload file. I am using wamp and Phpstorm. I went to wamp/bin/php/php5.5.12/php.ini. Within the code MAX_FILE_SIZE is 1mb. But when I am trying to upload say 100kb, it stops working. – imrul kaish Apr 14 '15 at 09:30

1 Answers1

0

In your php.ini file, change this variable upload_max_filesize to whatever max_uploaded_size you wish to have.

But remember, to keep your post_max_size greater than or equal to upload_max_filesize.

For more info, see this answer. PHP change the maximum upload file size

Community
  • 1
  • 1
Ankit Kumar
  • 180
  • 9