• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Open local files in browser

bmcorum

Lurker
I need to be able to open a html file that is located in the root directory. I have read several post that state you can access file on the sdcard through the browser using 'file://sdcard/pathToFile' I assumed since the file I need to load is located at the root I need only use 'file://pathToFile'. In my root folder there is a file name 'hello.html' therefore I enter 'file://hello.html' into the address bar of the browser and get a 'no such file or directory' error. I verified the file does in fact exist at root/hello.html. What am I doing wrong? I have tried 'file:///hello.html' as well.
 
I suspect your browser does not have the capability to look anywhere but /sdcard. That's just how it was programmed. And you do realize that any file you put at the root level will be gone at next reboot, right? You should put your files in the /sdcard mount and access it via file:///sdcard/yourfolder/yourfile.html


BTW, welcome to the forums! :)
 
Instead of opening it directly through the browser, open it in ES File Explorer. It'll prompt you want program to open the file in, and you can select to open it in a web browser.
 
ESt doesnt work for a swf file, trying to open it thru a browser, it shows the programs of movies players..
but to open it directly from the browser, use
file:///mnt/sdcard/FILENAME
 
I need to be able to open a html file that is located in the root directory. I have read several post that state you can access file on the sdcard through the browser using 'file://sdcard/pathToFile' I assumed since the file I need to load is located at the root I need only use 'file://pathToFile'. In my root folder there is a file name 'hello.html' therefore I enter 'file://hello.html' into the address bar of the browser and get a 'no such file or directory' error. I verified the file does in fact exist at root/hello.html. What am I doing wrong? I have tried 'file:///hello.html' as well.
Not knowing if you're using the default Android browser or what, this might not be the solution you're looking for but for the Firefox for Android browser there's an addon called 'Open Local File'. It adds a 'Open Local File' option to Firefox's 'Tools' menu.
https://addons.mozilla.org/en-US/android/addon/open-local-file/
 
Guys the OP hasn't been here for 4 years. Unfortunately Jasmine74 resurrected this dead thread
 
Back
Top Bottom