|
1 | | -# Filesystem / Cloud Storage |
2 | | - |
3 | 1 | <!-- markdownlint-disable no-inline-html --> |
4 | | -<!-- # File Storage System --> |
| 2 | +<!-- # Filesystem / Cloud Storage --> |
| 3 | + |
| 4 | +# File Storage System |
5 | 5 |
|
6 | 6 | A file storage system is a system used to store and manage files. It's a crucial part of most applications, as it helps you create, read, update, store and delete files effectively. Leaf provides a simple and easy-to-use file storage system that allows you to work with files on your server or in the cloud. |
7 | 7 |
|
| 8 | +::: warning Docs version |
| 9 | +This documentation covers FS v2 and above. If you're using an older version, you can check the documentation [hosted here](https://v3.leafphp.dev/modules/fs/). |
| 10 | +::: |
| 11 | + |
8 | 12 | ## Installation |
9 | 13 |
|
10 | 14 | You can quickly install Leaf's file storage system through composer or the leaf cli. |
@@ -173,20 +177,21 @@ One amazing thing about the `upload()` method is that it can detect the file typ |
173 | 177 | ```php |
174 | 178 | $uploaded = storage()->upload('fileToUpload', 'path/to/uploads', [ |
175 | 179 | 'maxSize' => 1024 * 1024, // 1MB |
176 | | - 'allowedTypes' => 'image', |
| 180 | + 'allowedTypes' => ['image'], |
177 | 181 | 'allowedExtensions' => ['jpg', 'png', 'gif'], |
178 | | - 'rename' => true, |
179 | | - 'force' => true, |
180 | | - 'overwrite' => false, |
181 | 182 | 'validate' => true, |
| 183 | + 'mode' => 0777, |
| 184 | + 'rename' => false, |
| 185 | + 'recursive' => false, |
| 186 | + 'overwrite' => false, |
182 | 187 | ]); |
183 | 188 | ``` |
184 | 189 |
|
185 | 190 | This is a list of config options for the `upload()` method: |
186 | 191 |
|
187 | 192 | | Config Name | Description | Possible Values | |
188 | 193 | | :----------- | :----------------------------------------------------------- | ------------------------------------------------------------------------------------: | |
189 | | -| force | If `true`, Leaf will create the folder if it doesn't exist | `true`, `false` | |
| 194 | +| mode | Permissions to create your destination folder if it doesn't exist | Any permissions accepted by mkdir() | |
190 | 195 | | overwrite | If `true`, Leaf will overwrite the file if it already exists | `true`, `false` | |
191 | 196 | | rename | If `true`, Leaf will rename the file if it already exists | `true`, `false` | |
192 | 197 | | validate | If `true`, Leaf will validate the file before uploading | `true`, `false` | |
|
0 commit comments