[英]Upload photo on Ionic 3
我正在使用本機html文件輸入上傳照片,該文件在iOS上工作正常,但是當我在android中嘗試此操作時,它什么也沒做。
我的html
<input id="photo-input" type="file" name="file" (change)="onChange($event)" accept=".png, .jpg, .jpeg">
我的ts
文件。
onChange(event) {
...
}
要使用Ionic應用程序上載/下載文件,請使用Ionic Native中的文件傳輸插件。
我設法通過編寫代碼來解決了這個問題,我能夠從圖庫中加載圖像。
<input id="photo-input" type="file" name="file" (change)="onChange($event)" accept="image/*">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.