upload_progress_jsonp_parameter

The `upload_progress_jsonp_parameter` directive specifies the name of the JSONP parameter used to return upload progress information in JSONP format.

Syntaxupload_progress_jsonp_parameter ;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The upload_progress_jsonp_parameter directive is utilized within the NGINX upload progress tracking module to define the name of the query parameter that will be used for JSONP callbacks. When the client-side application makes a request to retrieve upload progress, it can include this parameter in the request URL. NGINX will recognize the parameter and format the response data accordingly, allowing the response to be executed as a JavaScript function call, thus providing a seamless experience for monitoring upload progress in applications that require JSONP for cross-domain requests.

The directive must be defined in the appropriate context, such as within http, server, or location blocks, depending on where upload progress tracking is desired. The typical usage pattern allows developers to customize the callback parameter name as needed by the client application. The value set for this directive should be a string that indicates the desired name for the JSONP parameter, such as 'callback', enabling clients to receive formatted progress reports directly into specified callback functions.

It is important to ensure that the parameter name defined in this directive matches the one anticipated by the client-side application to avoid issues with receiving upload progress updates. This directive works in conjunction with the overall upload progress reporting mechanism NGINX offers, which utilizes shared memory and an event-driven model to track the state and progress of uploads efficiently.

Config Example

location /upload {
    track_uploads my_zone 10s;
    upload_progress_jsonp_parameter callback;
}

Ensure that the parameter name matches what the client-side application expects to avoid issues with the JSONP callback not firing.

Remember to include the track_uploads directive in the same or a parent context to enable upload progress monitoring.

← Back to all directives