I already read How to submit additional form data and it in fact works. But what I am trying to accomplish is to update the formData every time a chunk is sent, so the new data is sent to the server along with the chunk.
This is what I have tried:
$('#upload').fileupload({
maxChunkSize: 100000, // 100KB
formData: {UploadID: 'just testing'},
}).bind('fileuploadchunkdone', function (e, data) {
UId = data.jqXHR.responseJSON.files[0].UploadId;
console.log(UId); // Confirmed, it does have the data sent back by the server
data.formData = {UploadID: UId}; // It updates, but doesn't send the new data
}).bind('fileuploadchunksend', function (e, data) {
// tried the same here, but no luck
});
Using Firebug I can see the data sent to the server. The first chunk sends the formData correctly, but the second chunk sends the same data again.
I also tried what is described here by the author, but overriding the send handler doesn't work because it only happens on the first chunk.
Any idea how I can achieve this?