You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+61-61Lines changed: 61 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -444,89 +444,89 @@ The Upload plugin also comes with a `FileImport` behavior and a `FileGrabber` be
444
444
## Behavior options:
445
445
446
446
*`pathMethod`: The method to use for file paths. This is appended to the `path` option below
447
-
* Default: (string) `primaryKey`
448
-
* Options:
449
-
* flat: Does not create a path for each record. Files are moved to the value of the 'path' option.
450
-
* primaryKey: Path based upon the record's primaryKey is generated. Persists across a record update.
451
-
* random: Random path is generated for each file upload in the form `nn/nn/nn` where `nn` are random numbers. Does not persist across a record update.
452
-
* randomCombined: Random path - with model id - is generated for each file upload in the form `ID/nn/nn/nn` where `ID` is the current model's ID and `nn` are random numbers. Does not persist across a record update.
447
+
* Default: (string) `primaryKey`
448
+
* Options:
449
+
* `flat`: Does not create a path for each record. Files are moved to the value of the 'path' option.
450
+
* `primaryKey`: Path based upon the record's primaryKey is generated. Persists across a record update.
451
+
* `random`: Random path is generated for each file upload in the form `nn/nn/nn` where `nn` are random numbers. Does not persist across a record update.
452
+
* `randomCombined`: Random path - with model id - is generated for each file upload in the form `ID/nn/nn/nn` where `ID` is the current model's ID and `nn` are random numbers. Does not persist across a record update.
453
453
*`path`: A path relative to the `APP_PATH`. Should end in `{DS}`
*`rootDir`: Root directory for moving images. Auto-prepended to `path` and `thumbnailPath` where necessary
470
-
* Default (string) `ROOT . DS . APP_DIR . DS`
470
+
* Default (string) `ROOT . DS . APP_DIR . DS`
471
471
*`mimetypes`: Array of mimetypes to use for validation
472
-
* Default: (array) empty
472
+
* Default: (array) empty
473
473
*`extensions`: Array of extensions to use for validation
474
-
* Default: (array) empty
474
+
* Default: (array) empty
475
475
*`maxSize`: Max filesize in bytes for validation
476
-
* Default: (int) `2097152`
476
+
* Default: (int) `2097152`
477
477
*`minSize`: Minimum filesize in bytes for validation
478
-
* Default: (int) `8`
478
+
* Default: (int) `8`
479
479
*`maxHeight`: Maximum image height for validation
480
-
* Default: (int) `0`
480
+
* Default: (int) `0`
481
481
*`minHeight`: Minimum image height for validation
482
-
* Default: (int) `0`
482
+
* Default: (int) `0`
483
483
*`maxWidth`: Maximum image width for validation
484
-
* Default: (int) `0`
484
+
* Default: (int) `0`
485
485
*`minWidth`: Minimum image width for validation
486
-
* Default: (int) `0`
486
+
* Default: (int) `0`
487
487
*`deleteOnUpdate`: Whether to delete files when uploading new versions (potentially dangerous due to naming conflicts)
488
-
* Default: (boolean) `false`
488
+
* Default: (boolean) `false`
489
489
*`thumbnails`: Whether to create thumbnails or not
490
-
* Default: (boolean) `true`
490
+
* Default: (boolean) `true`
491
491
*`thumbnailMethod`: The method to use for resizing thumbnails
492
-
* Default: (string) `imagick`
493
-
* Options:
494
-
* imagick: Uses the PHP `imagick` extension to generate thumbnails
495
-
* php: Uses the built-in PHP methods (`GD` extension) to generate thumbnails. Does not support BMP images.
492
+
* Default: (string) `imagick`
493
+
* Options:
494
+
* imagick: Uses the PHP `imagick` extension to generate thumbnails
495
+
* php: Uses the built-in PHP methods (`GD` extension) to generate thumbnails. Does not support BMP images.
496
496
*`thumbnailName`: Naming style for a thumbnail
497
-
* Default: `NULL`
498
-
* Note: The tokens `{size}` and `{filename}` are both valid for naming and will be auto-replaced with the actual terms.
499
-
* Note: As well, the extension of the file will be automatically added.
500
-
* Note: When left unspecified, will be set to `{size}_{filename}` or `{filename}_{size}` depending upon the value of `thumbnailPrefixStyle`
497
+
* Default: `NULL`
498
+
* Note: The tokens `{size}` and `{filename}` are both valid for naming and will be auto-replaced with the actual terms.
499
+
* Note: As well, the extension of the file will be automatically added.
500
+
* Note: When left unspecified, will be set to `{size}_{filename}` or `{filename}_{size}` depending upon the value of `thumbnailPrefixStyle`
501
501
*`thumbnailPath`: A path relative to the `rootDir` where thumbnails will be saved. Should end in `{DS}`. If not set, thumbnails will be saved at `path`.
502
-
* Default: `NULL`
503
-
* Tokens:
504
-
* {ROOT}: Replaced by a `rootDir` option
505
-
* {DS}: Replaced by a `DIRECTORY_SEPARATOR`
506
-
* {model}: Replaced by the Model Alias
507
-
* {field}: Replaced by the field name
508
-
* {size}: Replaced by the size key specified by a given `thumbnailSize`
509
-
* {geometry}: Replaced by the geometry value specified by a given `thumbnailSize`
502
+
* Default: `NULL`
503
+
* Tokens:
504
+
* {ROOT}: Replaced by a `rootDir` option
505
+
* {DS}: Replaced by a `DIRECTORY_SEPARATOR`
506
+
* {model}: Replaced by the Model Alias
507
+
* {field}: Replaced by the field name
508
+
* {size}: Replaced by the size key specified by a given `thumbnailSize`
509
+
* {geometry}: Replaced by the geometry value specified by a given `thumbnailSize`
510
510
*`thumbnailPrefixStyle`: Whether to prefix or suffix the style onto thumbnails
511
-
* Default: (boolean) `true` prefix the thumbnail
512
-
* Note that this overrides `thumbnailName` when `thumbnailName` is not specified in your config
511
+
* Default: (boolean) `true` prefix the thumbnail
512
+
* Note that this overrides `thumbnailName` when `thumbnailName` is not specified in your config
513
513
*`thumbnailQuality`: Quality of thumbnails that will be generated, on a scale of 0-100. Not supported gif images when using GD for image manipulation.
514
-
* Default: (int) `75`
514
+
* Default: (int) `75`
515
515
*`thumbnailSizes`: Array of thumbnail sizes, with the size-name mapping to a geometry
516
-
* Default: (array) empty
517
-
*`thumbnailType`: Override the type of the generated thumbnail
518
-
* Default: (mixed) `false` or `png` when the upload is a Media file
519
-
* Options:
520
-
* Any valid image type
516
+
* Default: (array) empty
517
+
* `thumbnailType`: Override the type of the generated thumbnail
518
+
* Default: (mixed) `false` or `png` when the upload is a Media file
519
+
* Options:
520
+
* Any valid image type
521
521
*`mediaThumbnailType`: Override the type of the generated thumbnail for a non-image media (`pdfs`). Overrides `thumbnailType`
522
-
* Default: (mixed) `png`
523
-
* Options:
524
-
* Any valid image type
522
+
* Default: (mixed) `png`
523
+
* Options:
524
+
* Any valid image type
525
525
*`saveDir`: Can be used to turn off saving the directory
526
-
* Default: (boolean) `true`
527
-
* Note: Because of the way in which the directory is saved, if you are using a `pathMethod` other than flat and you set `saveDir` to false, you may end up in situations where the file is in a location that you cannot predict. This is more of an issue for a `pathMethod` of `random` and `randomCombined` than `primaryKey`, but keep this in mind when fiddling with this option
526
+
* Default: (boolean) `true`
527
+
* Note: Because of the way in which the directory is saved, if you are using a `pathMethod` other than flat and you set `saveDir` to false, you may end up in situations where the file is in a location that you cannot predict. This is more of an issue for a `pathMethod` of `random` and `randomCombined` than `primaryKey`, but keep this in mind when fiddling with this option
528
528
*`mode`: The UNIX permissions to set on the created upload directories.
0 commit comments