Copy attachments as temporary files before sending#6
Copy attachments as temporary files before sending#6
Conversation
Fix multiple attachments android
Revert "Fix multimple attachments android"
…ents-fix Fix multiple attachments android
Fixed a syntax error in RNMailModule.
Fixed various issue in android with multiple attachments.
This was necessary in my case as the files were local to the app. May not be necessary in other cases, in which case a boolean switch should be added.
|
@timscott your input on this PR would be useful. |
| copy (file, temporaryFile); | ||
| } catch (IOException e) { | ||
| e.printStackTrace(); | ||
| Log.e("RNMail", "Error copying to temporary file"); |
There was a problem hiding this comment.
Should probably fail here as temporaryFile will be null
|
I guess you are solving the problem that the mail program will not have permission to the original file if it's an app asset? I have solved that in my use case, by using However, I agree that it would be good to handle this case in a built-in way, and copying to a temp file seems fine. Some questions:
|
|
Thanks for those points. I had a look and found some documentation which looks like this issue could be avoided by using the FileProvider: https://developer.android.com/training/secure-file-sharing/share-file |
|
Cool, it would be great if you could get that working. It would allow me to delete some code from my app. My favorite coding is deleting code! |
This was necessary in my case as the files were local to the app. May not be necessary in other cases, in which case a boolean switch should be added.