Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read/write to file using jQuery

Tags:

jquery

file

Is there a way to get jQuery to get information to and from a file? Is it possible? How?

like image 980
menardmam Avatar asked Feb 24 '09 15:02

menardmam


2 Answers

No, JavaScript doesn't have access to writing files as this would be a huge security risk to say the least. If you wanted to get/store information server-side, though, you can certainly make an Ajax call to a PHP/ASP/Python/etc. script that can then get/store the data in the server. If you meant store data on the client machine, this is impossible with JavaScript alone. I suspect Flash/Java may be able to, but I am not sure.

If you are only trying to store a small amount of information for an unreliable period of time regarding a specific user, I think you want Web Storage API or cookies. I am not sure from your question what you are trying to accomplish, though.

like image 186
Paolo Bergantino Avatar answered Sep 19 '22 14:09

Paolo Bergantino


Yes it is possible.

The technique is described below

http://jquery.tiddlywiki.org/twFile.html

like image 39
ja. Avatar answered Sep 20 '22 14:09

ja.