to achieve this goal you need two things.
- you need to read a selected file within the filesystem
- you need to implement sqlite in javascript unless the browser supports it (maybe it has been implemented already)
there are optional ways to store data on the clients side:
- localStorage
- sessionStorage
- cookie
- file caching
out of theese the most reliable would be the cookie. the bad sideeffect would be that every request to your site forwards the cookies to your http server (within the http request header)
besides that, the cookie has a storage quota that is limited to 4kb. so if you store 2 cookies you get 2kb for each or 1kb for the first and 3kb for the second.
localStorage: 2,5 MB for Chrome, 5 MB for Firefox and Opera and 10 MB for Internet Explorer.
the good parts:
- it will be stored untill its wiped
- it is accessible on a key - value based architecture.
localStorage["foo"] = "bar";
the bad part would be that it is only accessible through javascript.
sessionStorage is the same as localStorage however it will be deleted as soon as you close your browser.
file caching is like resource hacking. you could forward a unique file to the user that contains all the data you want to store and let it read from cache each time.
bad parts:
- will get deleted as soon as the offline storage quota is reached
- will need to be set by your webserver
- bad idea unless you srsly can make use of it.
now why did i not mention how to use sql?
for reading a file in IE you simply can use ActiveX components. this requires that the user has set low security settings and that the user actually allows the website to gain file access.
for reading a file in chrome and other browsers or an alternative way for IE with html5 support:
- you can read files by draging them into the browser window
- you can also read files by selecting them in a file select box
- you can read files through plugins
the third way to read files would be the most reliable but it requires that the user has java enabled.
through java you could read files.
now the sqlite part:
- you could implement sqlite in javascript. (i would not want to do that)
- you could use the obsolete sqlite database for html5. (thats what you are asking for) it has been replaced by localStorage.
- you could implement it in java or a browserplugin. (maybe easyer but still i'd prefer localStorage)
maybe this helps you.