Skip to content

Commit 1f4f53d

Browse files
committed
docs: update documents for config
1 parent d9430a3 commit 1f4f53d

File tree

1 file changed

+149
-40
lines changed

1 file changed

+149
-40
lines changed

docs/config.md

Lines changed: 149 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ All users can upload and manage files within shared folders. Set to `false` to t
6161
* default:
6262

6363
```
64-
'folder_categories' => [
64+
'folder_categories' => [
6565
'file' => [
6666
'folder_name' => 'files',
6767
'startup_view' => 'list',
@@ -89,65 +89,174 @@ All users can upload and manage files within shared folders. Set to `false` to t
8989
],
9090
```
9191

92-
The default config creates two folder categories, `file` and `image`, each operates independently. Files uploaded by users will be placed under one of these folder categories, depend on which is configured with your WYSIWYG editor or stand-alone upload button.
92+
The default config creates two folder categories, `file` and `image`, each operates independently. Files uploaded by users will be placed under one of these folder categories, depend on which is configured with your WYSIWYG editor or stand-alone upload button.
9393

94-
## Startup Views:
94+
Detail options are explained here:
9595

96-
| Key | Type | Description |
97-
|-----------------------|--------|-----------------------------------------------------------------|
98-
| images\_startup\_view | string | The default display type for images. Supported: "grid", "list". |
99-
| files\_startup\_view | string | The default display type for files. Supported: "grid", "list". |
96+
* `folder_name`: The folder name of the category. For example, if `folder_name` is set to `files2` then:
97+
* directory path of the private folder will be: `/<path-to-laravel>/storage/app/public/files2/<user-id>/`
98+
* directory path of the shared folder will be: `/<path-to-laravel>/storage/app/public/files2/shares/`
99+
* `startup_view`: The default display mode. Available options: `list` & `grid`.
100+
* `max_size`: The maximum size(in KB) of of a single file to be uploaded.
101+
* `valid_mime`: Only files with mime types listed here are allowed to be uploaded. See [full mime types list](http://docs.w3cub.com/http/basics_of_http/mime_types/complete_list_of_mime_types/).
102+
103+
## Pagination:
104+
105+
### paginator
106+
107+
* type: `array`
108+
* default:
109+
110+
```
111+
'paginator' => [
112+
'perPage' => 30,
113+
],
114+
```
100115

101116

102117
## Upload / Validation:
103118

104-
| Key | Type | Description |
105-
|----------------------------|---------|---------------------------------------------------------------------------|
106-
| disk (Alpha version only) | string | Correspond to `disks` section in `config/filesystems.php`. |
107-
| rename_file | string | If true, the uploaded file will be renamed to uniqid() + file extension. |
108-
| alphanumeric_filename | string | If true, non-alphanumeric file name will be replaced with `_`. |
109-
| alphanumeric_directory | boolean | If true, non-alphanumeric folder name will be rejected. |
110-
| should\_validate\_size | boolean | If true, the size of uploading file will be verified. |
111-
| max\_image\_size | int | Specify max size of uploading image. |
112-
| max\_file\_size | int | Specify max size of uploading file. |
113-
| should\_validate\_mime | boolean | If true, the mime type of uploading file will be verified. |
114-
| valid\_image\_mimetypes | array | Array of mime types. Available since v1.3.0 . |
115-
| should\_create\_thumbnails | boolean | If true, thumbnails will be created for faster loading. |
116-
| raster\_mimetypes | array | Array of mime types. Thumbnails will be created only for these mimetypes. |
117-
| create\_folder\_mode | int | Permission setting for folders created by this package. |
118-
| create\_file\_mode | int | Permission setting for files uploaded to this package. |
119-
| should\_change\_file\_mode | boolean | If true, it will attempt to chmod the file after upload |
120-
| valid\_file\_mimetypes | array | Array of mime types. Available since v1.3.0 . |
119+
### disk
120+
121+
* type: `string`
122+
* default: `public`
123+
124+
Disk name of Laravel File System. All files are placed in here. Choose one of the `disks` section in `config/filesystems.php`.
125+
126+
### rename\_file
127+
128+
* type: `boolean`
129+
* default: `false`
130+
131+
If set to `true`, the uploaded file will be renamed using `uniqid()`.
132+
133+
### alphanumeric\_filename
134+
135+
* type: `boolean`
136+
* default: `false`
137+
138+
If set to `true`, non-alphanumeric file name will be replaced with `_`.
121139

122-
##### Appendix:
140+
### alphanumeric\_directory
123141

124-
* [full mime types list](http://docs.w3cub.com/http/basics_of_http/mime_types/complete_list_of_mime_types/)
125-
* [Laravel File Storage](https://laravel.com/docs/master/filesystem)
142+
* type: `boolean`
143+
* default: `false`
126144

145+
If set to `true`, non-alphanumeric folder name will be rejected.
127146

128-
## Thumbnail dimensions:
147+
### should\_validate\_size
148+
149+
* type: `boolean`
150+
* default: `false`
151+
152+
If set to `true`, the size of uploading file will be verified.
153+
154+
### should\_validate\_mime
155+
156+
* type: `boolean`
157+
* default: `true`
158+
159+
If set to `true`, the mime type of uploading file will be verified.
160+
161+
### over\_write\_on_duplicate
162+
163+
* type: `int`
164+
* default: `false`
165+
166+
Define behavior on files with identical name. Setting it to `true` cause old file replace with new one. Setting it to `false` show `error-file-exist` error and abort the upload process.
167+
168+
## Thumbnail
169+
170+
### should\_create\_thumbnails
171+
172+
* type: `boolean`
173+
* default: `true`
174+
175+
If set to `true`, thumbnails will be created for faster loading.
176+
177+
### thumb\_folder\_name
178+
179+
* type: `string`
180+
* default: `thumbs`
181+
182+
Folder name to place thumbnails.
183+
184+
### raster\_mimetypes
185+
186+
* type: `array`
187+
* default:
188+
189+
```
190+
'raster_mimetypes' => [
191+
'image/jpeg',
192+
'image/pjpeg',
193+
'image/png',
194+
],
195+
```
196+
197+
Create thumbnails automatically only for listed types. See [full mime types list](http://docs.w3cub.com/http/basics_of_http/mime_types/complete_list_of_mime_types/).
198+
199+
### thumb_img_width
200+
201+
* type: `int`
202+
* default: `200`
203+
204+
Thumbnail images width (in px).
205+
206+
### thumb_img_height
207+
208+
* type: `int`
209+
* default: `200`
210+
211+
Thumbnail images height (in px).
212+
213+
Create thumbnails automatically only for listed types.
129214

130-
| Key | Type | Description |
131-
|--------------------|--------|--------------------------------------------------|
132-
| thumb\_img\_width | string | Width of thumbnail made when image is uploaded. |
133-
| thumb\_img\_height | string | Height of thumbnail made when image is uploaded. |
134215

135216

136217
## File Extension Information
137218

138-
| Key | Type | Description |
139-
|-------------------|-------|---------------------------------------------|
140-
| file\_type\_array | array | Map file extension with display names. |
141-
| file\_icon\_array | array | Map file extension with icons(font-awsome). |
219+
### file\_type\_array
220+
221+
* type: `array`
222+
* default:
223+
224+
```
225+
'file_type_array' => [
226+
'pdf' => 'Adobe Acrobat',
227+
'doc' => 'Microsoft Word',
228+
'docx' => 'Microsoft Word',
229+
'xls' => 'Microsoft Excel',
230+
'xlsx' => 'Microsoft Excel',
231+
'zip' => 'Archive',
232+
'gif' => 'GIF Image',
233+
'jpg' => 'JPEG Image',
234+
'jpeg' => 'JPEG Image',
235+
'png' => 'PNG Image',
236+
'ppt' => 'Microsoft PowerPoint',
237+
'pptx' => 'Microsoft PowerPoint',
238+
],
239+
```
142240

241+
Gives description for listed file extensions.
143242

144243
## php.ini override
145244

146-
| Key | Type | Description |
147-
|---------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------|
148-
| php\_ini\_overrides | array or boolean | These values override your php.ini settings before uploading files. Set these to false to ingnore and apply your php.ini settings |
245+
### php\_ini\_overrides
246+
247+
* type: `array` or `boolean`
248+
* default:
249+
250+
251+
```
252+
'php_ini_overrides' => [
253+
'memory_limit' => '256M',
254+
],
255+
```
256+
257+
These values override your php.ini settings before uploading files. Set these to false to ingnore and apply your php.ini settings
149258

150-
### Caveats
259+
⚠️ **Caveats**
151260

152261
The php\_ini\_overrides are applied on every request the filemanager does and are reset once the script has finished executing.
153262
This has one drawback: any ini settings that you might want to change that apply to the request itself will not work.

0 commit comments

Comments
 (0)