AlwaysLoveme / capacitor-plugin-filedownload

a file download plugin for Capacitor3.0+
MIT License
13 stars 7 forks source link

destination=EXTERNAL_STORAGE doesn't save the downloaded file #13

Open moose4lord opened 1 year ago

moose4lord commented 1 year ago

I'm having trouble getting files to download onto external storage on my Pixel 3a running Android 12. If I set destination=LIBRARY, the files go into the standard Downloads folder with no problems. But if I set destination=EXTERNAL_STORAGE and plug a USB drive into my phone (via a USB-OTG adapter), I get this error:

Error: download fail: /storage/emulated/0/img00001.jpg: open failed: EPERM (Operation not permitted)

I have granted my Ionic app permission to access "File and media". Is there another permission that needs approval for external storage?

Also, does the filedownload plugin support web apps? I've tried running "ionic serve" and launching the app in Chrome, but the HTTP download request is never sent. No error is thrown, the download() function just return the object {"path":""}. I'm guessing the plugin doesn't support PWAs, but just wanted to make sure.

AlwaysLoveme commented 1 year ago

I'm having trouble getting files to download onto external storage on my Pixel 3a running Android 12. If I set destination=LIBRARY, the files go into the standard Downloads folder with no problems. But if I set destination=EXTERNAL_STORAGE and plug a USB drive into my phone (via a USB-OTG adapter), I get this error:


Error: download fail: /storage/emulated/0/img00001.jpg: open failed: EPERM (Operation not permitted)

I have granted my Ionic app permission to access "File and media". Is there another permission that needs approval for external storage?

Also, does the filedownload plugin support web apps? I've tried running "ionic serve" and launching the app in Chrome, but the HTTP download request is never sent. No error is thrown, the download() function just return the object {"path":""}. I'm guessing the plugin doesn't support PWAs, but just wanted to make sure.

currently not supported Web Download