开发者

Can't get beyond a 2MB file upload limit in my form

开发者 https://www.devze.com 2023-01-16 06:51 出处:网络
I am trying to alter the upload_max_filesize to 4M using .htaccess php_value upload_max_filesize 4M But PHP continues to cap the开发者_StackOverflow社区 size at 2M

I am trying to alter the upload_max_filesize to 4M using .htaccess

php_value upload_max_filesize 4M

But PHP continues to cap the开发者_StackOverflow社区 size at 2M

upload_max_filesize 2M 2M 

Any suggestions?


Instead of using the htaccess try with:

<?php
ini_set("upload_max_filesize", "4M");
?>

I don't know if it works but it can be a workaround


As mck89 suggested, try using ini_set - if you're on a shared host you might need to use that function or place a php.ini file somewhere as not all hosts allow using .htaccess to set PHP configuration.


Here's the answer

<IfModule mod_php5.c>
    php_value upload_max_filesize 4M
</IfModule>

(a) Need to put the setting in a IfModule container (b) need to put the .htaccess file in the document root

Or at least that's how I got it to work...


You might also want to take a look at your post_max_size setting as it also affects upload size limits.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号