Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UploadedFile.php

function UploadedFile::getMaxFilesize

Returns the maximum size of an uploaded file as configured in php.ini.

Return value

int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX)

3 calls to UploadedFile::getMaxFilesize()
FileValidator::validate in vendor/symfony/validator/Constraints/FileValidator.php
Checks if the passed value is valid.
HttpKernelBrowser::filterFiles in vendor/symfony/http-kernel/HttpKernelBrowser.php
Filters an array of files.
UploadedFile::getErrorMessage in vendor/symfony/http-foundation/File/UploadedFile.php
Returns an informative upload error message.

File

vendor/symfony/http-foundation/File/UploadedFile.php, line 230

Class

UploadedFile
A file uploaded through a form.

Namespace

Symfony\Component\HttpFoundation\File

Code

public static function getMaxFilesize() : int|float {
    $sizePostMax = self::parseFilesize(\ini_get('post_max_size'));
    $sizeUploadMax = self::parseFilesize(\ini_get('upload_max_filesize'));
    return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX);
}
RSS feed
Powered by Drupal