upload_tame_arrays
The `upload_tame_arrays` directive controls whether uploaded file arrays are transformed into string values in NGINX.
Description
The upload_tame_arrays directive in the NGINX upload module allows for the configuration of uploaded file arrays. When set to 'on', this directive modifies the behavior of file uploads such that if multiple files are uploaded under the same field name, they will be concatenated into a single string value with a suitable separator. This can be beneficial for simplifying access to the uploaded data in some application scenarios where the array structure is not necessary. Conversely, when set to 'off', the module retains the default structure of file arrays, potentially leading to a more complex handling of uploaded files but preserving their original form with distinct access to each file.
Consult the context of use when applying this directive since changing from the default array behavior may alter how backend scripts or applications interpret the incoming data. The decision to utilize this directive should consider how uploaded file data is primarily consumed by downstream processes — whether they expect single string entries or arrays of files. Additionally, the handling of file segments in resumable uploads may also be affected by this configuration.
Config Example
server {
location /upload {
upload_pass /upload/process;
upload_tame_arrays on;
upload_store /tmp/uploads;
}
}Changing the directive from 'off' to 'on' might break backend applications expecting array structures.
Make sure that the separator used in concatenated strings does not conflict with the actual content of filenames.