28, May 2012

Max file size issue - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Max file size issue
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Max file size issue  (Read 3343 times)
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« on: Sep 18, 2006, 08:27:28 am »

I downloaded your php class and i have a form that uploads an mp3 to the server and it's ok for like under 2mb but then if it's bigger it gives me this

The uploaded file exceeds the max. upload filesize directive in the server configuration.

i set the max upload size to 50mb in the script. any idea whats wrong here?

Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 18, 2006, 08:57:25 am »

don't use this kind of high value...


you have also to raise the post_max_size and this value in the example script:

$max_size = 1024*250; // the max. size for uploading in bytes


the hidden tag
  <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_size; ?>">

must be the first element in your form


Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1525
6359 credits
Members referred : 8


Gimme all your cookies!!!


« Reply #2 on: Sep 18, 2006, 08:59:15 am »

If you're using php, you will have to update your php.ini to allow bigger files to be uploaded. The default is usually 2M in php. Check: upload_max_filesize = 2M


Last blog : Canonical URL Links / Tags
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Sep 18, 2006, 09:36:17 am »

If you're using php, you will have to update your php.ini to allow bigger files to be uploaded. The default is usually 2M in php. Check: upload_max_filesize = 2M
Thanks Wineo (I should better read)
If you don't have access to the php config you can try to change this values via htaccess:

just put this in a .htaccess in the folder:

Code:
php_value upload_max_filesize {new_bytes_max}


My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #4 on: Sep 18, 2006, 02:55:02 pm »

If you're using php, you will have to update your php.ini to allow bigger files to be uploaded. The default is usually 2M in php. Check: upload_max_filesize = 2M
Thanks Wineo (I should better read)
If you don't have access to the php config you can try to change this values via htaccess:

just put this in a .htaccess in the folder:

Code:
php_value upload_max_filesize {new_bytes_max}



so do i just create a .htaccess file and put that code directly into it? or should i change the new_bytes_max to something?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Sep 18, 2006, 03:19:43 pm »



so do i just create a .htaccess file and put that code directly into it? or should i change the new_bytes_max to something?
yes if your server support this feature, otherwise you need something different (ftp upload)

Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1525
6359 credits
Members referred : 8


Gimme all your cookies!!!


« Reply #6 on: Sep 18, 2006, 03:21:15 pm »

Yeah, use something like this:

Code:
php_value upload_max_filesize 128M
php_value post_max_size 128M


Last blog : Canonical URL Links / Tags
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #7 on: Sep 19, 2006, 02:46:00 am »

Ok i made a .htaccess file with
Code:
php_value upload_max_filesize 128M
php_value post_max_size 128M

and now it gives me this:

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@maliciousmetal.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Sad
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #8 on: Sep 19, 2006, 06:20:22 am »

Try adding

Code:
<?php

ini_set
("post_max_size""128M");
ini_set("upload_max_filesize""128M");

?>

at the top of your script, instead of the .htaccess change.


Last blog : Are You Stumbling Yet?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1525
6359 credits
Members referred : 8


Gimme all your cookies!!!


« Reply #9 on: Sep 19, 2006, 06:32:35 am »

Try adding

Code:
<?php

ini_set
("post_max_size""128M");
ini_set("upload_max_filesize""128M");

?>

at the top of your script, instead of the .htaccess change.

Try this... else you may have to alter the php.ini file. Remember though that we were never meant to upload such big file sizes this way and I am sure that with some server setups you may run into some problems trying to upload files bigger than about 30M.


Last blog : Canonical URL Links / Tags
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #10 on: Sep 19, 2006, 01:38:35 pm »

i tried putting that at the top but i got The uploaded file exceeds the max. upload filesize directive in the server configuration. again  Undecided

The file was only 4mb. Any idea how to change the php.ini file? i couldnt find it through my ftp program.
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #11 on: Sep 19, 2006, 01:43:48 pm »

if you are on shared hosting I don't think you will be able to change it. You could try asking your webhost company if they want to change it for you...


Last blog : Are You Stumbling Yet?
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #12 on: Sep 19, 2006, 01:47:49 pm »

ok i'll ask
My name is Bong, James Bong
*
Posts: 11
74 credits
Members referred : 0


« Reply #13 on: Sep 20, 2006, 01:24:45 am »

ok they set it to 32mb and it works Smiley thanks for the help
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1525
6359 credits
Members referred : 8


Gimme all your cookies!!!


« Reply #14 on: Sep 20, 2006, 10:42:23 am »

You're welcome!

He shouts... he scores!  Wink


Last blog : Canonical URL Links / Tags
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4138
Tags : php ftp hosting shared hosting php.ini Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Max file size issue
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:22:22 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.