How can I can open local files in the default Android browser?

  • I want to open local files that are on my sdcard in the Android browser. How can I accomplish this?

    This is pretty close to a duplicate...Open HTML file from SD card

    Sorry my search didn't catch that one. Yeah its pretty close - although I'm asking for more than just HTML files.

    I probably wouldn't vote to close this (if I had 3k), but now the other one shows up in the "Linked" area. I think I might go back and leave a comment on the other one so that searchers will get links both ways. These seem to get hits for very different search terms. **Edit**: Hm, the "Linked" section already links both ways, but I'll add a comment on the old one since it would be more visible...

  • Daniel

    Daniel Correct answer

    10 years ago

    In order to view local files on the sdcard with the default Android browser just enter file://sdcard/ and then the path to the file you want to view. For example if you have an xml file named "person" in a folder named "xmlfiles" it would look like file://sdcard/xmlfiles/person.xml in your address bar. You can create bookmarks for the file you are viewing but if you try to make a shortcut to that bookmark or use a bookmark widget (at least the HTC one) these will not work and may give an error "The linked program is no longer installed on your phone". The bookmarks will work if opened from within the browser.

    So far I have verified that the browswer can open/render these files: xml, html files(htm), and image files

    It cannot open pdfs.

    According to this comment it works for Android 2.1 and above

    This doesn't work for me with directories (so I can browse the file system rather than typing a lot): "The web page at file://sdcard/download could not be loaded as: Is a directory". Can that also be made to work somehow?

    what path must one use for internal storage??

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM