35

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

Daniel
  • 3,760
  • 2
  • 28
  • 35

4 Answers4

20

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

Daniel
  • 3,760
  • 2
  • 28
  • 35
4

Found a solution for the local file browser problem on my Xoom tablet

I tried opening a local file with Opera by typing file:///mnt/sdcard/Documents/blabla.html. Opera changed the adress in file://localhost/mnt/Documents... Using the localhost syntax on the android browser opened the local file.

bartender
  • 41
  • 1
3

The answer is here already, but I am adding my 2 cents worth. I am using the Galaxy Tab S 10.5 and for me "file://localhost/sdcard" works in the Chrome browser on Android that comes with this device. I thought that sdcard would refer to an external media device that you can plug in, but it turns out that the sdcard in this URI refers to the built-in memory of the device. I wanted to test some DIY wireframes (with JavaScript, XHTML and CSS) and they work once I enabled JavaScript for Chrome.

0

You can browse the file system with Firefox for Android

holger
  • 11