Not getting anything from the file path returned on Android.
See original GitHub issueThe result I get from the PictureTakenHandler, when on Android, looks like /data/data/com.myAppName/files/camerapreview_09_02_2016_1152_04_preview.jpg
From what I understand, that looks correct. However, when I try to simply use that path as the src attribute in an tag, I just get a broken image like maybe there is no file there.
Any idea why this may be happening? Does that path look correct? Might it be failing to actually store the picture there?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
Failing to get actual file path from storage in android
I suggest you get the file content using ContentResolver , copy it to a temp file in the cache, and then upload that...
Read more >itinance/react-native-fs - GitHub
Check in the Android assets folder if the item exists. filepath is the relative path from the root of the assets folder. If...
Read more >Path Operations - Essential Java Classes - Oracle Help Center
If the Path contains any redundant elements, it returns a path with those elements removed. This method throws an exception if the file...
Read more >Path | Android Developers
Returns true if the path is empty (contains no lines or curves) ... Clear any lines and curves from the path, making it...
Read more >Java File Path, Absolute Path and Canonical Path | DigitalOcean
getPath() : This file path method returns the abstract pathname as String. ... directory of the drive named by the pathname, if any;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Djagu Yes I have. Sorry. I should have posted back much sooner, but I had forgotten I posted here. I still haven’t been able get a path that I could use directly in an
's src attribute, but my ultimate goal was to get the file’s base64 for database storage, which works as a src attribute as well, so hopefully this helps you too.
After digging around a few different places, this is what my code looks like. Maybe you will understand what is going on here more than I do in order to better use it to fit your purposes. Unfortunately, I still don’t have a very firm grasp on handling files with JavaScript, but this got me the base64 data that I needed.
**Important Note: You need to append “file:///” to the beginning of your result in order for resolveLocalFileSystemURL() to work.
I hope that this helps.
what is the result[1] ??