diff --git a/system/Files/File.php b/system/Files/File.php index 02c8f181b19b..15b53262e9c2 100644 --- a/system/Files/File.php +++ b/system/Files/File.php @@ -59,7 +59,8 @@ public function __construct(string $path, bool $checkFile = false) * * Implementations SHOULD return the value stored in the "size" key of * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. + * on the actual size transmitted. A RuntimeException will be thrown if the file + * does not exist or an error occurs. * * @return false|int The file size in bytes, or false on failure */ diff --git a/user_guide_src/source/libraries/files.rst b/user_guide_src/source/libraries/files.rst index 0b55982692c2..8d2e90c9df46 100644 --- a/user_guide_src/source/libraries/files.rst +++ b/user_guide_src/source/libraries/files.rst @@ -46,6 +46,8 @@ Returns the size of the uploaded file in bytes: .. literalinclude:: files/004.php +A ``RuntimeException`` will be thrown if the file does not exist or an error occurs. + getSizeByUnit() =============== @@ -54,6 +56,8 @@ the results in kilobytes or megabytes, respectively: .. literalinclude:: files/005.php +A ``RuntimeException`` will be thrown if the file does not exist or an error occurs. + getMimeType() =============