CodeIgniter Forums
Uploaded File exceeds the maximum allowed size - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Uploaded File exceeds the maximum allowed size (/showthread.php?tid=9438)

Pages: 1 2


Uploaded File exceeds the maximum allowed size - El Forum - 06-25-2008

[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


Uploaded File exceeds the maximum allowed size - El Forum - 06-25-2008

[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



Uploaded File exceeds the maximum allowed size - El Forum - 06-25-2008

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


Uploaded File exceeds the maximum allowed size - El Forum - 06-25-2008

[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
;;;;;;;;;;;;;;;;;;



Uploaded File exceeds the maximum allowed size - El Forum - 06-25-2008

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


Uploaded File exceeds the maximum allowed size - El Forum - 06-26-2008

[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


Uploaded File exceeds the maximum allowed size - El Forum - 06-26-2008

[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


Uploaded File exceeds the maximum allowed size - El Forum - 10-08-2008

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


Uploaded File exceeds the maximum allowed size - El Forum - 10-08-2008

[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/actionscript-examples/flash-file-uploader/

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


Uploaded File exceeds the maximum allowed size - El Forum - 11-13-2008

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