php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14118 Upload file more than 1 Mb doesn't work
Submitted: 2001-11-19 11:55 UTC Modified: 2003-10-27 10:26 UTC
From: mlara at gcintl dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.4pl1 OS: linux redhat 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mlara at gcintl dot com
New email:
PHP Version: OS:

 

 [2001-11-19 11:55 UTC] mlara at gcintl dot com
I have a little script for uploading files, all work fine with files lower than 1 mb but if I try to upload a higher file I get the next browser error "The page cannot be displayed".

My script is:

<? //check for file upload
    if ($set=="go")
        {
            if (is_uploaded_file($UploadedFile))
                {
                        print("Local File: $UploadedFile <BR>\n");
                        print("Name: $UploadedFile_name <BR>\n");
                        print("Size: $UploadedFile_size <BR>\n");
                        print("Type: $UploadedFile_type <BR>\n");
                        print("<HR>\n");
             }
        }
?>

<FORM ENCTYPE="multipart/form-data"
    ACTION="test.php" METHOD=POST>
    <INPUT TYPE="hidden" name="MAX_FILE_SIZE"
    value="1024000">
    <INPUT NAME="UploadedFile" TYPE="file">
    <INPUT TYPE="hidden" name="set" value="go">
    <INPUT TYPE="submit" VALUE="Upload">
    </FORM>
    </BODY>
    </HTML>

My php.ini has a very higher configuration limits.

The parameters are:
max_execution_time = 3000
memory_limit = 16M    
post_max_size           =       80M  

; File Uploads ;
;;;;;;;;;;;;;;;;
file_uploads    = On    
upload_tmp_dir  = /tmp  
upload_max_filesize = 80M   


I read that the solution is upgrade php, I?m hoping that there are other solutions.

Thanks

Mauricio

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-19 18:43 UTC] sniper@php.net
This script works for me just fine. Note that to be
able to see the error message, you need to have this
directive enabled in php.ini: 

track_errors = On

Also note that if MAX_FILE_SIZE  is used and is set
to lower than the values in php.ini it will override them.
And the value it sets is in bytes. 

--------test.php---------
<?php  

print_r($HTTP_POST_FILES);
echo $php_errormsg;

?>

<FORM ENCTYPE="multipart/form-data" ACTION="test.php" METHOD=POST>

<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1024000">
<INPUT NAME="UploadedFile" TYPE="file">
<INPUT TYPE="hidden" name="set" value="go">
<INPUT TYPE="submit" VALUE="Upload">
</FORM>
</BODY>
</HTML>
--------test.php---------

 [2001-11-21 14:14 UTC] mlara at gcintl dot com
Thanks

I resolved my problem, the reason was that the squid configuration limit the request size, I changed this value and I can upload file more higher than 2 Mb .

Thanks for all, I?m sorry

Mauricio


 [2003-10-26 14:59 UTC] gregt_fletcher at yahoo dot com
I was experiencing a similar file upload limit problem with the following software stack:

Redhat 8
Apache 2.0.4
PHP 4.2.2

If you are getting errors like the following in your Apache log:

"Requested content-length of 2258901 is larger than the configured limit of 524288"

look for an additional PHP config file, /etc/httpd/conf.d/php.conf (this was the path for me on RH 8.0) and increase the limit on the line "LimitRequestBody 524288" to what you require


see http://www.squirrelmail.org/wiki/en_US/AttachmentSize
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 04:01:32 2024 UTC