plupload
plupload copied to clipboard
pluploadQueue setOption({ url: '/new/url' }) not working
Hi, i have issue with changing URL for chunks. for example:
i have large file (2GB) splited to chunks and i need to send it to separate URL adresses, but when i change url on BeforeChunkUpload then settings was ok, but request is still called on old url.
BeforeChunkUpload: function(up, file, postObj, blobObj, offset) { var urlsForFile = { urls : ['/chunk1','/chunk2','/chunk3','/chunk4','/chunk5','/chunk6'] }; up.setOption({ 'url': urlsForFile.urls[postObj.chunk] }); }
tried too up.setOption('url', urlsForFile.urls[postObj.chunk]) ... i tried up.refresh() etc, but nothing works.
May be the problem is wider, i'm getting the same kind of issue, when trying to change 'multipart_params' before sending any file... Step to reproduce, with the code below :
` $(function() { // Setup html5 version var uploader = $("#html5_uploader").pluploadQueue({ // General settings runtimes : 'html5', multipart : true, multipart_params : { tree : 'ORIGIN' }, url : "/upload.php", chunk_size : '1mb', unique_names : true,
// PreInit events, bound before any internal events
preinit : {
Init: function(up, info) {
console.log('[Init]');
},
UploadFile: function(up, file) {
up.setOption('multipart_params', {tree : 'JSONSTRING'});
}
},
// Post init events, bound after the internal events
init : {
BeforeUpload: function(up, file) {
up.setOption('multipart_params', {tree : 'JSONSTRING'});
}
}
});
});`
I am always getting the following in my post data :
` -----------------------------150831796211334 Content-Disposition: form-data; name="tree"
ORIGIN`
instead of "JSONSTRING"
Try up.setOption('params', ...)
instead of up.setOption('multipart_params', ...)
.
This might be related: https://github.com/moxiecode/plupload/issues/1593#issuecomment-483835701
I have the same issue with setting Url parameter in BeforeChunkUpload event up.setOption('url', 'my/url') does not work!