@lucaceck95 wrote:
Hi ionicers,
i’m stuck with this issue…my application has a
<input>
element for open media files
everything is ok with image and video files, but i’ve problems with audio files
when i select the file i need (on the phone), the file’s extension go blank and the filename is the old filename without extension.i’ve tried to accept only audio, and same thing happened…
how can i solve it?
this is my code
page.html
<ion-fab vertical="bottom" horizontal="center" slot="fixed"> <ion-fab-button> <label for="input" style="font-size: 20pt; padding: 30px"> + </label> <input accept="audio/*" type="file" class="hideInput" [(ngModel)]="fileInputChooser" (change)="changeListener($event)" (click)="clearFile()"> </ion-fab-button> </ion-fab>
page.ts
fileInputChooser: any; file: File; clearFile() ///for select the same file { this.fileInputChooser=undefined; } async changeListener($event) { /// if I choose testAudio.mp3" -> this.file = $event.target.files[0]; /// file.type = undefined /// file.filename = testAudio const popover = await this.popoverCtrl.create({ component: UploadImageConfirmPage, translucent: true }); await popover.present(); popover.onDidDismiss().then((mode) => { if (mode.data == 'upload') this.showToast('Content uploaded.'); this.load(); this.file = null; }); }
Posts: 1
Participants: 1