dynamically initialize uploader instances #1013

Open
opened 2018-04-25 16:30:00 +00:00 by pasangears · 3 comments
pasangears commented 2018-04-25 16:30:00 +00:00 (Migrated from github.com)

when click a + button I need to init a new uploader instance.
http://prntscr.com/ja18l4
check

when click a + button I need to init a new uploader instance. http://prntscr.com/ja18l4 [check](http://prntscr.com/ja18l4)
koenvanderlinden commented 2018-04-26 09:20:20 +00:00 (Migrated from github.com)

Maybe you can use the: <input type="file" ng2FileSelect [uploader]="uploader" />
And all these point to the same 'uploader' instance. As the uploader instance uses a queue to upload files. So the each ng2FileSelect is used to add a file to that single queue.

Maybe you can use the: `<input type="file" ng2FileSelect [uploader]="uploader" />` And all these point to the same 'uploader' instance. As the uploader instance uses a queue to upload files. So the each ng2FileSelect is used to add a file to that single queue.
pasangears commented 2018-04-27 11:39:22 +00:00 (Migrated from github.com)

Yes that is a good solution.But in my case I need to display separate uploading progress bars to each boxes.If I use one queue Its difficult to display separate uploading boxes to each dynamic boxes.

Yes that is a good solution.But in my case I need to display separate uploading progress bars to each boxes.If I use one queue Its difficult to display separate uploading boxes to each dynamic boxes.
reddevilzee commented 2018-04-27 13:47:37 +00:00 (Migrated from github.com)

@pasangears I assume it should be an array and if you have one input points to same uploader, then it will duplicate your uploaded image/file. You can initialize the uploader dynamically inside the function which happens when you click the button. So whenever you click a + button, an uploader instance will be initialized and each will carry out separate upload process. Make sure you point the uploader with the correct index of the array.

@pasangears I assume it should be an array and if you have one input points to same uploader, then it will duplicate your uploaded image/file. You can initialize the uploader dynamically inside the function which happens when you click the button. So whenever you click a + button, an uploader instance will be initialized and each will carry out separate upload process. Make sure you point the uploader with the correct index of the array.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1013