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]mironcho[/eluser]
Hi JamZee,
The problem is in your php configuration, not in CI's upload config. Simply change upload_max_filesize in your php.ini, e.g.:
Code:
upload_max_filesize = 10M
#3

[eluser]Chris Newton[/eluser]
You may have a problem changing the upload max size on a shared host. Some give you easy access to the php.ini or allow you to override it with an .htaccess file, but it just depends on the server.
#4

[eluser]Zeeshan Rasool[/eluser]
thnx Guys, i have change my php.ini from server but in phpinfo it shows yet 2M , Why?
prob. is still on
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
;;;;;;;;;;;;;;;;;;
#5

[eluser]Zeeshan Rasool[/eluser]
ok i get it..
After inc. size in php.ini fle. Restart the system makes it posible now i can upload upto 50 M
thnx guys.......
#6

[eluser]Xperia[/eluser]
You can also use
Code:
ini_set('upload_max_filesize','20M');
in your script, useful if one doesn't have access to edit php.ini
#7

[eluser]Seppo[/eluser]
[quote author="Xperia" date="1214502114"]You can also use
Code:
ini_set('upload_max_filesize','20M');
in your script, useful if one doesn't have access to edit php.ini[/quote]

You really can't do that... take a look here, upload_max_filesize is changeable PHP_INI_PERDIR, so you can change it on your php.ini or using .htaccess, the best solution if you can't modify your php.ini.

You can not use it on the run because the upload itself happens before the php file execution
#8

[eluser]jdgiotta[/eluser]
I'm having a problem with filesize exceeding the limit, but its not throwing an error to the upload library.
Instead my apache error log tells what happened and the web served result is a completely blank screen.

Please advice.
#9

[eluser]Chris Newton[/eluser]
I'd suggest using the following to handle large uploads rather than changing the PHP settings.

http://don.citarella.net/index.php/actio...-uploader/

It gives feedback (unlike standard PHP) and lets you get around the max_filesize thing pretty easily.
#10

[eluser]SitesByJoe[/eluser]
Where would you put the .htaccess file? Would you use the same .htaccess file that removes the index.php etc?




Theme © iAndrew 2016 - Forum software by © MyBB