Welcome Guest, Not a member yet? Register   Sign In
uploaded file exceeds the maximum allowed size
#1

[eluser]Zeeshan Rasool[/eluser]
Hi, plz help me in this case,
An error is there!
Error:The uploaded file exceeds the maximum allowed size in your PHP configuration file

My code is:

$config['upload_path'] = './resources/admin_videos';
$config['allowed_types'] = 'mp3';
$config['max_size'] = '500000';
$config['overwrite'] = false;

$this->upload->initialize($config);
$this->load->library('upload', $config);
if(!$this->upload->do_upload($video))
{
$error = array('error' => $this->upload->display_errors());
return $error;
}
else
{
$data = array('upload_data' => $this->upload->data());
$video_path =$data['upload_data']['file_name'];

}

////////// also included 'mp3' => array('audio/mpeg', 'audio/mpg') but no result
Any guy who know the solu.
....................JamZee
#2

[eluser]Sumon[/eluser]
Seems to me it's an server issue rather then CI.

There are two considerable factors for upload any file. These are
1. Execution time
3. File Size.

Your script must need to execute until the file is uploaded completely. And offcourse your server alow your expected upload file size. Php have default configuration for both issue. Execution time is set by default 60 seconds. And allowed maximum file size is up to 2MB. Now what shall you do for a audio or video file. Your internet connection might slow and need more execution time then default. Again you may need more file size to be allowed then 2MB. The question is how??

Would you please check the link for detail explanation.
http://shopno-dinga-php.blogspot.com/200...n-php.html
#3

[eluser]Dagobert Renouf[/eluser]
If you're in local though, you could change the max file size parameters in your php.ini file.
#4

[eluser]Tartaron[/eluser]
Hello

I have the same problem trying to upload a video, I allready did what you suggested and in my local php.ini I have the max size up to 200M and in my code I set it to unlimited but is not working and i´m trying to upload a 2.2MB video

Code:
set_time_limit(0);
ini_set("upload_max_filesize",25);


        
$vconfig['upload_path'] = './assets/uploads/video/';
$vconfig['allowed_types'] = 'flv';
$vconfig['max_size']= '0';
            
$this->load->library('upload', $vconfig);
            
$nombre_video = $_FILES['video']['name'];          
if ( ! $this->upload->do_upload('video'))
{
    echo $this->upload->display_errors();
    echo $nombre_video;
}

Please help me
#5

[eluser]cideveloper[/eluser]
have you checked phpinfo() to make sure the new 200M setting has taken? also is file_uploads. Also

Quote:upload_max_filesize integer
The maximum size of an uploaded file.
When an integer is used, the value is measured in bytes.

go through the php.net site for more info
#6

[eluser]InsiteFX[/eluser]
Increase Maximum PHP Upload Size
Many shared hosts put very low restrictions on the size of the files that can be uploaded through PHP. But, many hosts also allow you to create your own php.ini file in the root directory of your site. This file can override some of the servers default PHP settings. If not already done simply create a php.ini file and place in the public_html directory of your site. If the server is configured correctly, after inserting this snippet the servers default max upload will be overridden.

For this example it was changed to 20 megabytes.
Code:
; Maximum file size of post data that PHP will accept.
post_max_size = 20M

; Maximum allowed file size for uploaded files.
upload_max_filesize = 20M

InsiteFX
#7

[eluser]Tartaron[/eluser]
I checked both of your solutions and I still have the same problem, in my php.ini I have:

post_max_size = 80M
upload_max_filesize = 20M

also checked the phpinfo() and it´s not set to integer

I sent the file size as part of the error report with

Code:
set_time_limit(0);
ini_set("upload_max_filesize",25);
$nombre_video = $_FILES['video']['name'];
$size = $_FILES['video']['size'];
            
$vconfig['upload_path'] = './assets/uploads/video/';
$vconfig['allowed_types'] = 'flv';
$vconfig['max_size']= '0';
            
$this->load->library('upload', $vconfig);
            
    
if ( !$this->upload->do_upload('video'))
{
    echo $this->upload->display_errors();
    echo $nombre_video.': ';
    echo $size.' bytes';
}

and I got this
The uploaded file exceeds the maximum size allowed by the submission form.
A001 video.flv: 0 bytes
#8

[eluser]cideveloper[/eluser]
try to take these 2 lines out

Code:
ini_set("upload_max_filesize",25);

$vconfig['max_size']= '0';
#9

[eluser]InsiteFX[/eluser]
post_max_size = 80M
upload_max_filesize = 80M

They both have to be set to the same value or it will not work!




Theme © iAndrew 2016 - Forum software by © MyBB