This using Blob ( https://developer.mozilla.org/en-US/docs/Web/API/Blob ) and HTML5 Feature ( http://updates.html5rocks.com/2011/08/Downloading-resources-in-HTML5-a-download )
Main Article in Stackoverflow:
http://stackoverflow.com/questions/16329293/save-json-string-to-client-pc-using-html5-api