initialize called twice resolve in double upload
Closed this issue · 1 comments
Hi
thanks for this great work!
I have an issue if i twice or more call the initialize method of the uploader with the same options.
on upload it uploads every file as often as i initialized the uploader.
it seems i have to initialize it for each change in the "data" option, couse on my page the user have the option to shrink their images (via checkbox on/off) on upload.
I do not know how to deliver the new data variable instead of initialize the html5 upload new.
ans this results in double or more upload (as often as the user click on on/off) uploads for the selected file.
is there any possible solution to get tand set the data object in the moment the customer triggers the uploader? (instead of only in initialize)
kindly regards
When you initialize it, it actually returns UploadManager instance:
Later on you can actually update data on that instance directly:
var manager = html5Upload.initialize({ ... });
// Later, specify updated data:
manager.data = { resize: true };
It should be clear what you can change by looking at this: