@@ -18,13 +18,15 @@ By default, the file does not need to exist. However, you can pass an additional
1818to check that the file exists and throw ``FileNotFoundException() `` if it does not.
1919
2020.. literalinclude :: files/001.php
21+ :lines: 2-
2122
2223Taking Advantage of Spl
2324***********************
2425
2526Once you have an instance, you have the full power of the SplFileInfo class at the ready, including:
2627
2728.. literalinclude :: files/002.php
29+ :lines: 2-
2830
2931New Features
3032************
@@ -38,13 +40,15 @@ You can generate a cryptographically secure random filename, with the current ti
3840method. This is especially useful to rename files when moving it so that the filename is unguessable:
3941
4042.. literalinclude :: files/003.php
43+ :lines: 2-
4144
4245getSize()
4346=========
4447
4548Returns the size of the uploaded file in bytes:
4649
4750.. literalinclude :: files/004.php
51+ :lines: 2-
4852
4953getSizeByUnit()
5054===============
@@ -53,6 +57,7 @@ Returns the size of the uploaded file default in bytes. You can pass in either '
5357the results in kilobytes or megabytes, respectively:
5458
5559.. literalinclude :: files/005.php
60+ :lines: 2-
5661
5762getMimeType()
5863=============
@@ -61,6 +66,7 @@ Retrieve the media type (mime type) of the file. Uses methods that are considere
6166the type of file:
6267
6368.. literalinclude :: files/006.php
69+ :lines: 2-
6470
6571guessExtension()
6672================
@@ -70,6 +76,7 @@ will return null. This is often a more trusted source than simply using the exte
7076the values in **app/Config/Mimes.php ** to determine extension:
7177
7278.. literalinclude :: files/007.php
79+ :lines: 2-
7380
7481Moving Files
7582============
@@ -78,12 +85,15 @@ Each file can be moved to its new location with the aptly named ``move()`` metho
7885the file to as the first parameter:
7986
8087.. literalinclude :: files/008.php
88+ :lines: 2-
8189
8290By default, the original filename was used. You can specify a new filename by passing it as the second parameter:
8391
8492.. literalinclude :: files/009.php
93+ :lines: 2-
8594
8695The move() method returns a new File instance that for the relocated file, so you must capture the result if the
8796resulting location is needed:
8897
8998.. literalinclude :: files/010.php
99+ :lines: 2-
0 commit comments