Many people assume that client-side JavaScript cannot perform file-system operations
on the client computer.
Actually, the objects needed are often found in the browsers, and the rest is only a matter
of compatibility (the way IE saves files is very different from the way Firefox saves files...)
and of permissions.
In order to perform critical file-system operations, the script must be granted privileges.
There are different ways to get these privileges, and unfortunately, these are very different
depending on the browser your application run on.
I won't debate long on the subject of security and permissions in the browser, others did that much
better than me (check Google for more information). The
demo here demonstrates as
a proof of concept that saving a file locally is possible in both major web clients available
today (IE and Firefox, tested only on Windows platform).