upload_progress_header
The upload_progress_header directive sets the name of the HTTP header used to report upload progress.
Description
The upload_progress_header directive is designed to specify the name of the HTTP header that will be used to report the upload progress to clients during file uploads. This header is important because it allows client-side scripts to track the progress of an upload operation in real-time. The module records the progress of uploads through unique identifiers and uses the specified header to provide updates to the client about the current state of the upload, such as how much has been uploaded and how much is remaining.
The directive can be placed within the contexts of 'http', 'server', or 'location', which means it can apply to an entire server block, specific servers, or specific locations, thereby allowing for flexible configurations tailored to the needs of different routes and resources. The expected value is a string representing the header name. For example, a common usage might be 'X-Upload-Progress', allowing JavaScript on the client side to listen for this header and update the user interface accordingly.
When configuring this directive, it should be noted that the specified header name must not collide with existing headers used by the application or any headers that may be required by other modules or configurations. Additionally, ensure that the header is properly processed in the application logic that manages uploads, so it can effectively communicate the upload state to the client.
Config Example
server {
location /upload {
upload_progress_header X-Upload-Progress;
...
}
}Make sure the specified header name does not conflict with existing HTTP headers.
The progress tracking will only work if uploads are properly configured and tracked with the upload_progress directive.
If the client does not handle the specified header appropriately, it may lead to confusion regarding the upload state.