Sending Multiple Parameters with the Same Key

I’m trying to upload multiple files using a single POST request by setting singleRequest to true. I want to set a specific property (e.g., param1) for each file in uploader.params. I want to set multiple param1[] arrays in the request parameters so the server can receive them as an array. However, uploader.params is a key-value associative array, so I can’t set the same key multiple times. Is there a good way to do this?

Hello,

It is possible to pass values related to specific uploaded items and process them on the server side.

For example:

uploader.send({
    param1: ["value1", "value2"],
    param2: ["value1", "value2"]
});

On the server, these values will arrive as a string rather than a real array and may require parsing.

Another possible approach is to use identifiers as keys:

uploader.send({
    id_1: ["param_value_1", "param_value_2"],
    id_2: ["param_value_1", "param_value_2"]
});

In this case, the backend maps values using the identifiers and the order of parameters.