ng2FileSelect and cordova camera plugin File type to FileItem type #873
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?
Hi,
I am using ng2FileSelect to upload files.
Here is ts code:
this.uploader.onAfterAddingAll = (fileItems: any[]) => { this.handleAddedFiles(fileItems); };and this is my template:
<input #uploadInput type="file" id="formFiles" name="formFiles" accept="{{acceptedFormats}}" ng2FileSelect [uploader]="uploader" multiple hidden="hidden" />So if I understand correctly this.uploader.onAfterAddingAll is working with FileItems type.
My problem is when I take the picture from camera on android device I am getting base64 string as image. I can convert it to File type but still I cannot use it as argument for this.uploader.onAfterAddingAll
Is there a way to convert File type to FileItem type?
Thanks in advance
How did you solve it?
I am not sure that I solved it.