Dreamweaver 2.
This function writes the specified string to the specified file. If the specified file does not yet exist, it is created.
fileURL,text,{mode}
fileURL argument, which is expressed as a file:// URL, is the file to which you are writing.
text argument is the string to be written.
mode argument, if it is supplied, must be "append". If this argument is omitted, the contents of the file are overwritten by the string.
A Boolean value: true if the string is successfully written to the file; false otherwise.
The following code attempts to write the string "xxx" to the mydata.txt file and displays an alert message if the write operation succeeds. It then tries to append the string "aaa" to the file and displays a second alert if the write succeeds. After executing this script, the mydata.txt file contains the text xxxaaa and nothing else.
var fileURL = "file:///c|/temp/mydata.txt";
if (DWfile.write(fileURL, "xxx")){
alert("Wrote xxx to " + fileURL);
}
if (DWfile.write(fileURL, "aaa", "append")){
alert("Appended aaa to " + fileURL);
}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/dreamweaver/8/apiref/02_fil17.htm