I'm using Ionic v1 with $cordovaFile and cordova email plugin to create a file and then attach it to a new email. I have a working solution for iOS on any device, but I've come across a weird issue with Android.
When attempting to attach a file created in any internal storage location on Android (dataDirectory, etc), I receive "permission denied for attachment". However, when I save the file to external storage, the attachment is successfully added.
I have published my application using external storage for Android, but unfortunately some of today's most popular devices don't have external storage.
Does anyone know a solution? I've considered workarounds, such as uploading the file to a file-hosting service, and including a download link in the email. I would use $cordovaFileTransfer, but I don't know if there would be permissions errors in internal storage. I'd like to use a true email attachment if possible. Thanks!
I think your issue is related to permission. I have implemented this for file attachment to give a permission for file attachment try it hope this help you. Try this plugin
cordova.plugins.permissions