简体   繁体   中英

file uploading in php not working for more than 20kb (i looked up all possible questions here)

       <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..

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM