Part of the EllisLab Network
   
 
Uploaded File exceeds the maximum allowed size
Posted: 25 June 2008 07:31 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  355
Joined  06-05-2008

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

 Signature 

Zeeshan RasooL
Lahore - Pakistan
http://www.99Points.info


Facebook Wall Script Facebook Style Extract URL data with JQuery Ajax Rating System Script Who Am I

Profile
 
 
Posted: 25 June 2008 11:06 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  142
Joined  04-18-2007

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

upload_max_filesize 10M 
Profile
 
 
Posted: 25 June 2008 11:26 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  497
Joined  10-11-2007

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.

 Signature 

BarrettNewton.com
CartThrob.com

Profile
 
 
Posted: 26 June 2008 12:23 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  355
Joined  06-05-2008

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

 Signature 

Zeeshan RasooL
Lahore - Pakistan
http://www.99Points.info


Facebook Wall Script Facebook Style Extract URL data with JQuery Ajax Rating System Script Who Am I

Profile
 
 
Posted: 26 June 2008 01:38 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  355
Joined  06-05-2008

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

 Signature 

Zeeshan RasooL
Lahore - Pakistan
http://www.99Points.info


Facebook Wall Script Facebook Style Extract URL data with JQuery Ajax Rating System Script Who Am I

Profile
 
 
Posted: 26 June 2008 08:41 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  5
Joined  03-26-2008

You can also use

ini_set('upload_max_filesize','20M'); 

in your script, useful if one doesn’t have access to edit php.ini

Profile
 
 
Posted: 26 June 2008 09:07 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  550
Joined  10-18-2006
Xperia - 26 June 2008 12:41 PM

You can also use

ini_set('upload_max_filesize','20M'); 
in your script, useful if one doesn’t have access to edit php.ini

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

 Signature 

Once in a while I remember I use Twitter

Profile
 
 
Posted: 08 October 2008 04:35 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Avatar
Total Posts:  15
Joined  02-26-2008

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.

Profile
 
 
Posted: 08 October 2008 06:22 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  497
Joined  10-11-2007

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.

 Signature 

BarrettNewton.com
CartThrob.com

Profile
 
 
Posted: 13 November 2008 01:11 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  180
Joined  10-28-2006

Where would you put the .htaccess file?  Would you use the same .htaccess file that removes the index.php etc?

 Signature 

“Clean, Simple & Elegant Web Design”

Profile
 
 
Posted: 13 November 2008 01:39 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  497
Joined  10-11-2007

In the past I’ve put some PHP.ini overrides in the root .htaccess and they’ve worked fine. Basically wherever your script is running from (in this case the index.php file) at that level or above, up to the root level.

 Signature 

BarrettNewton.com
CartThrob.com

Profile
 
 
Posted: 14 November 2008 01:55 AM   [ Ignore ]   [ # 11 ]  
Summer Student
Avatar
Total Posts:  9
Joined  10-24-2008
SitesByJoe - 13 November 2008 06:11 PM

Where would you put the .htaccess file?

Most likely in the root directory of CI.

Would you use the same .htaccess file that removes the index.php etc?

Yes, thats probably the best spot.

 Signature 

Adam Leayr

Currently moving all development to CodeIgniter and ExpressionEngine.

Profile
 
 
   
 
 
‹‹ load library      htaccess is not working ››