Issue with *ngFor upload.uploadAll() not working #1015
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I am using ng2FileSelect with *ngFor
The sample code looks something like this
Basically what i am trying to do is I have exampleSet that can either contains textualexample or image + text as example as shown above. And whenever a new image is selected I push that image into exampleSet and preview for the same is available. While uploading this data to the server what I did is
I segregate the Images using something like this
and then I try to upload the images using
this.uploader.uploadAll();but the Upload request is not sent to the server. I checked theuploaderweather it is working or not using<input type="file" title="upload image" ng2FileSelect [uploader]="uploader" accept="image/png,image/gif,image/jpeg" multiple />but this is working absolutely fine and as expected. What am I doing wrong. any help would be appretiated/#998 I think this may solve the problem. Haven't tried it yet. Will acknowledge once tried this option
@mayur9293 In your code I see you use this.uploader.queue.push(). I think you should use the method addToQueue(files: File[], options?: FileUploaderOptions, filters?: FilterFunction[] | string).
If you inspect the source code of addToQueue, it does a whole lot more then just adding a file to a local array.