Skip to content

Commit 2acec9d

Browse files
committed
add doc of getSizeByUnit method
1 parent 3f9ed80 commit 2acec9d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

user_guide_src/source/libraries/files.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ the results in kilobytes or megabytes, respectively::
6868
$kilobytes = $file->getSize('kb'); // 250.880
6969
$megabytes = $file->getSize('mb'); // 0.245
7070

71+
**getSizeByUnit()**
72+
73+
Returns the size of the uploaded file default in bytes. You can pass in either 'kb' or 'mb' as the first parameter to get
74+
the results in kilobytes or megabytes, respectively::
75+
76+
$bytes = $file->getSizeByUnit(); // 256901
77+
$kilobytes = $file->getSizeByUnit('kb'); // 250.880
78+
$megabytes = $file->getSizeByUnit('mb'); // 0.245
79+
7180
**getMimeType()**
7281

7382
Retrieve the media type (mime type) of the file. Uses methods that are considered as secure as possible when determining

0 commit comments

Comments
 (0)