17

I'v searching for a while in php.net and I don't find what I'm searching. I need a function to know the max_upload_filesize from a PHP function.

Here what I need: http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize

Thanks in advance!

3 Answers 3

41

Use ini_get() function:

<?php
$upload_max_size = ini_get('upload_max_filesize');
Sign up to request clarification or add additional context in comments.

Comments

17

In addition to upload_max_filesize, watch out for post_max_size. Whichever is the smaller will be enforced

1 Comment

That was very important information! To increase upload file size limit adjusting two parameters was needed. I struggled a while with WordPress wondering why the limit doesnẗ come up...
0

Use PHP's ini_get to get the config value.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.