Reputation: 559
I'm here because I have a very particular problem, but first a piece of background information:
I'm setting up a website that isn't made to run online on a server. It just should run locally on the client's computer being saved on the clients stick, because I wanna avoid being dependent on the internet. Added to that I don't wanna save data using cookies or smth. similar, because I cannot be dependent on the browser or the computer (as already said above: the website is saved on someones stick).
So there's the problem that I want to save user-data in a text-file via javascript. Coming of Java I thought there would be not problem doing that. But after some research I heard that this isn't possible due to security problems (which sounded logically).
But in my case these security problems are not really relevant in view of the facts that it runs locally and is made for a very small group of trusting people (10-15 people).
So is there a way to just put some small user-data in a text-file (theoretically the file could already be created, but empty) in the folder of the website?
Upvotes: 1
Views: 2450
Reputation: 81
Running a small HTTP server is a working possibility. Name the html file index.html. On Linux, python has a built in HTTP server with python, python -m SimpleHTTPServer
. On the Windows systems, I include an HTTP server exe, like HFS, in the same folder. The website can be connected to using localhost. Something like localStorage would work then.
There's probably something better than this, but it worked. http://www.rejetto.com/hfs/
Upvotes: 1