Within Upload-Presets, when specifying both the Allowed-formats
and Format
parameters, the semantics of these fields change.
Normal Behavior (Without Both Parameters):
- By default,
Allowed-formats
is not specified. Any uploaded file format (e.g., JPG, PNG, PDF) is allowed. Format
can be used to define a specific output format for all uploaded files. For example, ifFormat
is set tojpg
, all uploads (regardless of their original format) will be converted to JPG upon upload.
Changed Behavior (With Both Parameters):
- When you define both
Allowed-formats
andFormat
, their usual roles change. Allowed-formats
becomes a whitelist, specifying the only file formats that will be accepted for upload. Any format not listed inAllowed-formats
will be rejected.Format
now applies only to files whose formats are not included in theAllowed-formats
list. These non-allowed formats will be converted to the format specified inFormat
.- Files with formats included in the
Allowed-formats
list will be uploaded and stored without modification, preserving their original format.
In essence:
Allowed-formats
acts as a filter, controlling which file types can be uploaded.Format
(when used withAllowed-formats
) defines the conversion target format for non-allowed file types. Allowed formats remain unchanged.
Comments
0 comments
Please sign in to leave a comment.