Click to See Complete Forum and Search --> : writing to a text file using execCommand('SaveAs')


debbie
12-10-2002, 03:36 AM
I am using the followng code to save a textarea to an iframe named SaveFrame which then gets written to a text file:

var txt, crlf;
txt = '';
txt += formObj.emails.value;

SaveFrame.document.open("text/html","replace")
SaveFrame.document.write(txt)
SaveFrame.document.close()
SaveFrame.focus()
SaveFrame.document.execComman('SaveAs',true,'email.txt')

This works fine, however, my text area has carriage return in it that are diplaying very well in the text field :

debbie@moodia.com

debbie_seidman@hotmail.com
etc...

when I write the iframe to my text file, I need the output to preserve these carriage return!! at the moment, the text file displays:

debbie@moodia.com; debbie_seidman@hotmail.com;

Please help

Many thanks

wernergillwald0
03-22-2007, 09:46 AM
Try some at www.verticalresponse.com, how the files run into http--/--php , write it to an http file in any case .