You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I follow those steps, I see the index always the same and the fileId undefined.
I was expecting the index and the fileId to have the correct values.
For context I'm using the event to append a path to the formdata to upload to a given directory. I need the fileId to get its webkitRelativePath and construct the correct path for each file.
All I could use now is the previewId which is not practical at all and the size of the file but it's not reliable as I could have two files with the same size.
I see similar issue with fileuploaded, the index is wrong. Getting 1 when it should be 0
Looking at the source code, looks i is incremented before the task is executed
Source code: self._uploadSingle(i, id, true, deferrer); is called at a delay but the i++ is already called, so you get 1 for i when self._uploadSingle is called
if (self.uploadAsync) {
i = 0;
var pool = self.ajaxPool = tm.addPool($h.uniqId());
$.each(self.getFileStack(), function (id) {
pool.addTask(id + i, function (deferrer) {
self._uploadSingle(i, id, true, deferrer);
}); i++;
});
Prerequisites
master
branch of bootstrap-fileinput.Steps to reproduce the issue
Demo : https://jsfiddle.net/groseb/Lp2wb8rg/3/
Expected behavior and actual behavior
When I follow those steps, I see the index always the same and the fileId undefined.
I was expecting the index and the fileId to have the correct values.
For context I'm using the event to append a path to the formdata to upload to a given directory. I need the fileId to get its webkitRelativePath and construct the correct path for each file.
All I could use now is the previewId which is not practical at all and the size of the file but it's not reliable as I could have two files with the same size.
Thanks for your help
Environment
Browsers
Operating System
Libraries
Isolating the problem
The text was updated successfully, but these errors were encountered: