Android Html5 Fileapi Can I Read File From Sd Card?
Solution 1:
The HTML5 Filesystem API allows web pages to open and manipulate files only within a sandboxed filesystem. The browser decides where and how this sandboxed filesystem exists, and your webpage cannot break out of the sandbox to access arbitrary files on the device's actual filesystem.
What you can do is provide a file input element (<input type=file>
) that allows the user to specify a file that your webpage can then upload/read. In that case, the user can select any file within the device's filesystem, including mounted SD cards. See the HTML5 Rocks tutorial on reading files.
So, no, there is no way to do precisely what you want, for security reasons.
(Unless, of course, the webpage were hosted on the device itself and the file in question sat in your website directory. Then you could load it from the server via an Ajax call or similar (that is, load it from the device itself, which hosts the page).)
Post a Comment for "Android Html5 Fileapi Can I Read File From Sd Card?"