Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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

share|improve this question
1  
This is pretty close to a duplicate...Open HTML file from SD card –  eldarerathis Apr 14 '11 at 23:55
    
Sorry my search didn't catch that one. Yeah its pretty close - although I'm asking for more than just HTML files. –  Daniel Apr 15 '11 at 0:02
    
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... –  eldarerathis Apr 15 '11 at 0:05
    
@eldarerathis Yeah that will automatically happen when you provide a link in the comments to another Android SE question –  Daniel Apr 15 '11 at 0:27
    
@Daniel: I thought it was just one-way for some reason. Learned something new! –  eldarerathis Apr 15 '11 at 3:51

3 Answers 3

up vote 13 down vote accepted

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

share|improve this answer
    
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? –  nealmcb Aug 19 '11 at 5:13

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.

share|improve this answer

You can browse the file system with Firefox for Android

share|improve this answer
3  
In case anyone wants to try this, it's not obvious how to do it as there doesn't seem to be any option or button that lets you do it. If you select the address box at the top of the windows and type in file:// and then press enter you should see a file listing that lets you browse into directories and click on the files to view them. –  GAThrawn Sep 5 '11 at 19:58
    
@GAThrawn "ERR_ACCESS_DENIED" –  Spook Jul 22 at 21:23
    
@Spook I thought that it was possible that things had changed in the 3 years since I wrote that comment, but no. I just tried it on my Nexus 5 (Android 4.4.4) and my Xoom (4.1.2), both running Firefox 31, and it works in both. Firefox does change ‘file://’ to ‘file:///’ but that's the only difference from my comment above. –  GAThrawn Jul 24 at 22:38
    
@GAThrawn Then it seems to be a problem with Samsung Galaxy devices. Tried on S4 and 10.1 2014 and got the same results :( –  Spook Jul 25 at 10:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.