I am using ng2-file-upload to manage file uploading in my Angular 6 application. What I want to achieve is to be able to upload multiple files using the same uploader:FileUploader
object, but every file should have a different URL.
public uploader: FileUploader = new FileUploader();
<div ng2FileDrop
[ngClass]="{'dz-file-over': hasBaseDropZoneOver}"
(fileOver)="fileOverBase($event)"
[uploader]="uploader"
class="fileupload-drop-zone">
Drop required files here
</div>
I am able to use onBeforeUploadItem
to change the URL of every file right before it gets uploaded.
this.uploaderCustomerIdentificaiton.onBeforeUploadItem = (fileItem): any => {
fileItem.url = newUrl;
return {fileItem};
};
For every file I need to upload, I will have separate (notice that it's the same uploader object).
<div ng2FileDrop [uploader]="uploader"....</div>
So every ng2FileDrop should have a different URL.