Search code examples
javascriptjsonflat-file

With JavaScript is it possible to Read/Write from/to a file on the server


I have a series of JSON Objects I want to save locally on my server. I am attempting to avoid any server-side script like PHP as required per demand of whats being built. I know its a security risk, but that in this case is not a particular worry. So that said is it possible to actually write to a file and or get its contents via javascript with or without the help of a lib such as jquery?

I should mention I am attempting to avoid ActiveX as I know this is an IE only feature and the software we are developing is planned to be Cross Browser supported


Solution

  • So that said is it possible to actually write to a file and or get its contents via javascript with or without the help of a lib such as jquery?

    Nope. You will need something running on server side that can receive your JavaScript input and write it to the server.

    Internet Explorer's proprietary file writing functionality is for writing local (client-side) files only.