0

Possible Duplicate:
Cross-browser Save As .txt

I'm looking for a way to save a sting of data to a file only using HTML5 and Javascript, without using any server-side techniques (PHP, ASP etc..)

I'm using URI for the moment :

<script>
 var content = "test";
 uriContent = "data:plain/text.," + encodeURIComponent(content);
 newWindow=window.open(uriContent, 'test');
</script>

However the browsers don't name the file with the right extension. I'm wondering is there a way to save strings without using only using HTLM5 + Javascript

Community
  • 1
  • 1
fen4o
  • 1
  • 2

1 Answers1

2

Unfortunately we are not there yet. There is a draft for a FileWriter API but it's not implemented in most browsers.

If you can fall back to Flash you should take a look at Downloadify.

david
  • 471
  • 4
  • 13