File tree Expand file tree Collapse file tree
user_guide_src/source/libraries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,17 +96,17 @@ Moving Files
9696Each file can be moved to its new location with the aptly named ``move() `` method. This takes the directory to move
9797the file to as the first parameter::
9898
99- $file->move(WRITEPATH. 'uploads');
99+ $file->move(WRITEPATH . 'uploads');
100100
101101By default, the original filename was used. You can specify a new filename by passing it as the second parameter::
102102
103103 $newName = $file->getRandomName();
104- $file->move(WRITEPATH. 'uploads', $newName);
104+ $file->move(WRITEPATH . 'uploads', $newName);
105105
106106The move() method returns a new File instance that for the relocated file, so you must capture the result if the
107107resulting location is needed::
108108
109- $file = $file->move(WRITEPATH. 'uploads');
109+ $file = $file->move(WRITEPATH . 'uploads');
110110
111111****************
112112File Collections
@@ -136,8 +136,7 @@ When your collection is complete, you can use ``get()`` to retrieve the final li
136136 echo 'My files: ' . implode(PHP_EOL, $files->get());
137137 echo 'I have ' . count($files) . ' files!';
138138
139- foreach ($files as $file)
140- {
139+ foreach ($files as $file) {
141140 echo 'Moving ' . $file->getBasename() . ', ' . $file->getSizeByUnit('mb');
142141 $file->move(WRITABLE . $file->getRandomName());
143142 }
You can’t perform that action at this time.
0 commit comments