File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -173,20 +173,21 @@ One amazing thing about the `upload()` method is that it can detect the file typ
173173``` php
174174$uploaded = storage()->upload('fileToUpload', 'path/to/uploads', [
175175 'maxSize' => 1024 * 1024, // 1MB
176- 'allowedTypes' => 'image',
176+ 'allowedTypes' => [ 'image'] ,
177177 'allowedExtensions' => ['jpg', 'png', 'gif'],
178- 'rename' => true,
179- 'force' => true,
180- 'overwrite' => false,
181178 'validate' => true,
179+ 'mode' => 0777,
180+ 'rename' => false,
181+ 'recursive' => false,
182+ 'overwrite' => false,
182183]);
183184```
184185
185186This is a list of config options for the ` upload() ` method:
186187
187188| Config Name | Description | Possible Values |
188189| :----------- | :----------------------------------------------------------- | ------------------------------------------------------------------------------------: |
189- | force | If ` true ` , Leaf will create the folder if it doesn't exist | ` true ` , ` false ` |
190+ | mode | Permissions to create your destination folder if it doesn't exist | Any permissions accepted by mkdir() |
190191| overwrite | If ` true ` , Leaf will overwrite the file if it already exists | ` true ` , ` false ` |
191192| rename | If ` true ` , Leaf will rename the file if it already exists | ` true ` , ` false ` |
192193| validate | If ` true ` , Leaf will validate the file before uploading | ` true ` , ` false ` |
You can’t perform that action at this time.
0 commit comments