upload_empty_fiels_names
The `upload_empty_file_names` directive controls whether or not empty file fields in file uploads should be retained in the request sent to the backend server.
Description
In the context of handling file uploads, it is common for clients to submit forms that include file input fields where no file is actually uploaded, resulting in empty fields. The upload_empty_file_names directive allows users to specify whether these empty file names should be passed through to the next stage of request processing. When set to 'on', empty file fields will be included in the request sent to the configured upload processing location, enabling the server to handle them accordingly. Conversely, if set to 'off', these empty fields will be omitted, potentially reducing the size of the request and avoiding the need for handling unnecessary empty fields on the server side. This directive thus provides flexibility in customization of how file uploads are processed and allows for anticipating backend requirements for handling empty fields.
Config Example
location /upload {
upload_pass /upload_handler;
upload_empty_file_names on;
}Make sure to consider the backend server's handling of empty fields if you are enabling this directive.
Keep in mind that enabling this directive will increase the complexity of processing requests on the server side if empty fields are included.