Closed Thilaga14 closed 8 years ago
It's the same as the example in the README. What problem are you having?
None of the files are being sent to the server at all?
Can you explain exactly what is happening when you try to upload a file?
Also, set debug: true
in your settings and let me know what it says your browser console.
In console :
[Uploader] Commencing upload using multipart form [Uploader] Server response: {"Audit_ID" : "21"}
That is actually how the plugin works -- it only sends one file per request. The reason is to support multiple, concurrent file uploads in IE7-9. When multiple files are being uploaded, each file upload is a separate request.
It is not even sending multiple request. It is sending one request and one file. You can prevent using both multipart:true and multiple: true at the same time.
Thanks !
What browser are you using?
Chrome
I'm not sure what the issue could be. It doesn't seem like there should be any reason why you are only having one request when you select more than one file.
Is there a way you can post a link to a live example? If you can't do that, can you post or link to the full code?
Is the one file that is being sent successfully uploading?
yes. I can read and store
I think I've figured it out. I think it's because you have autoSubmit: false
and when you submit the upload here:
self.state.myUploader.submit();
It's only submitting the first file because when autoSubmit
is false
, the plugin does not automatically submit the next file. You could do something like this:
if(self.state.isFileSelected)
{
console.log(' an file upload');
self.state.myUploader.setOptions({
data : data
});
var num = self.state.myUploader.getQueueSize();
for ( var i = 0; i < num; i++ ) {
self.state.myUploader.submit();
}
}
This finds how many files were selected using getQueueSize()
and then submits each file individually.
Can you try this and see if it works?
Yup! you solved it . Thanks :). I can see multiple request with one file at a time.
Last question for better understanding,
Chrome - select n files and send n requests, one file at time. IE7-9 - not able to select multiple files as browser is not supporting IE10+ - works like chrome.
is anything possible like one request with multiple files ?
correct me if i am wrong.
Glad I could help. You're correct about the browsers.
One request with multiple files might be possible. I'd have to work on it, but it could potentially be in a future release. I'll look into it.
Resolved..
how to upload multiple files using multipar:true.
anyexamples?