apache / apache/cordova-plugin-file

resolveLocalFileSystemURL: incorrect filename

Open
#261 3 comments 1 reaction 0 assignees View on GitHub
platform: android support
Dominant language
JavaScript
Stars
744
Forks
754
Avg merge
3d 4h
Merged PRs (30d)
1

Description

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/XX@gmail.com/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/XX@gmail.com/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/XX@gmail.com/message_attachment_external/%23t
}
```
I'd expect the `info.txt` instead of the `0.1`

Contributor guide

Open the contributing guide

Research direction

Start at the resolveLocalFileSystemURL entry point and trace how the Android content URI is converted into a FileEntry name. Reproduce the case with the provided Gmail attachment URI, verify why 0.1 is selected instead of info.txt, and confirm the returned name matches the attachment filename.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.