ng2FileSelect and cordova camera plugin File type to FileItem type #873

Open
opened 2017-08-24 15:36:50 +00:00 by kukipei · 2 comments
kukipei commented 2017-08-24 15:36:50 +00:00 (Migrated from github.com)

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

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
Kaidanov commented 2018-05-24 08:26:53 +00:00 (Migrated from github.com)

How did you solve it?

How did you solve it?
kukipei commented 2018-05-25 06:01:20 +00:00 (Migrated from github.com)

I am not sure that I solved it.

I am not sure that I solved it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#873