webCOMAND

php_util::get_max_file_upload()

Returns the maximum number of bytes that will be accepted for a file upload in PHP based on a number of factors, optionally including repository file storage size limits.

The minimum size of the following will be used to determine what is returned.

  • post_max_size - from php.ini or set at runtime
  • upload_max_filesize - from php.ini or set at runtime
  • max file storage size - from storage engine configuration, such as max_allowed_packet from my.cnf for MySQL.

Prototype

int get_max_file_upload(repo $repo = NULL)

Parameters

  • repo - Optional repository to consider.  When provided, the maximum will be limited to the maximum repository file storage size.

Example

$repo = \comand::repo();
$max = \io_comand_util\php_util::get_max_file_upload($repo);
echo($max);