cordova-plugin-file
cordova-plugin-file copied to clipboard
resolveLocalFileSystemURL: incorrect filename
I have an email with attachment - let's say info.txt
there is an intent handler which is ment to open the attachment in the Android app
I'm using the resolveLocalFileSystemURL
to read the file, the url is in format like:
"content://com.google.android.gm.sapi/[email protected]/message_attachment_external/%23thread-a%3Ar-5057787201526387426/%23msg-a%3Ar-7956362123961253525/0.1?account_type=com.google&mimeType=application%2Foctet-stream&rendition=1"
FileEntry
returned from the resolveLocalFileSystemURL
contains incorrect name ("0.1"
) e.g:
{
fullPath: "/com.google.android.gm.sapi/[email protected]/message_attachment_external/#thread-a:r-5057787201526387426/#msg-a:r-7956362123961253525/0.1"
isDirectory: false
isFile: true
name: "0.1"
nativeURL: "content://com.google.android.gm.sapi/[email protected]/message_attachment_external/%23t
}
I'd expect the info.txt
instead of the 0.1
I have an email with attachment - let's say
info.txt
there is an intent handler which is ment to open the attachment in the Android app I'm using theresolveLocalFileSystemURL
to read the file, the url is in format like:"content://com.google.android.gm.sapi/[email protected]/message_attachment_external/%23thread-a%3Ar-5057787201526387426/%23msg-a%3Ar-7956362123961253525/0.1?account_type=com.google&mimeType=application%2Foctet-stream&rendition=1"
FileEntry
returned from theresolveLocalFileSystemURL
contains incorrect name ("0.1"
) e.g:{ fullPath: "/com.google.android.gm.sapi/[email protected]/message_attachment_external/#thread-a:r-5057787201526387426/#msg-a:r-7956362123961253525/0.1" isDirectory: false isFile: true name: "0.1" nativeURL: "content://com.google.android.gm.sapi/[email protected]/message_attachment_external/%23t }
I'd expect the
info.txt
instead of the0.1
Did you find a solution to this?
I had the same problem and used https://github.com/mobius3/cordova-plugin-filename as a workaround to get the correct filename and it's working so far.
Thank you @rockkiska for linking to that plugin! I struggled for a long time to find a solution