I use File.open("user://file.txt", File.WRITE), but from a html5 build it doesn't save anything
Not sure. As far as I know, browsers can't access the host file-system directly for security reasons, so they are always sandboxed. Some engines support saving files for HTML5 builds, but exactly how depends on the engine. You might do well to ask on IRC for more information.