php_upload_limit problem? Heres a quick fix

php_upload_limit problem? Heres a quick fix

Postby Nomad on Thu Oct 11, 2007 7:59 pm

HAving a problem with the default file size upload in php? It's set to 2mb by default and some may want it higher but not have access to there php.ini to increase the size..

Well there is a way to do it via your .htaccess - I've just tested this and uploaded a file in excess of 3mb's to make sure (Was around 3.6mb's)

It works from your root .htaccess

simple add the following (Uncomment the hash symbols to make it work)


Code: Select all
#php_value upload_max_filesize 5M
#php_value post_max_size 8M


Now if you look the second value is higher than the first - thats done on purpose. Ok say the file you upload is 4mb's and you add a whole load of text say 500kb (extreme example) - if the post size was normal or set lower than the file upload then the post would fail as the limit would have been exceeded so you need the post size higher than the file upload so it will work correctly.

I've been a bit extreme in the example to catch your attention on that but I'd say you would be safe with a post_max_size of 5.5M

just found this HERE

many thanks for the tip I say :)

As I say - I've just tested it and it works as a work around :)
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Return to Requests and Suggestions