Adobe 38040334 - Dreamweaver CS3 User Manual page 17

Api reference
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

DWfile.read()
Availability
Dreamweaver 2.
Description
This function reads the contents of the specified file into a string.
Arguments
fileURL
• The
argument, which is expressed as a file:// URL, is the file you want to read.
fileURL
Returns
A string that contains the contents of the file or a
Example
The following code reads the mydata.txt file and, if it is successful, displays an alert message with the contents of the
file:
var fileURL = "file:///c|/temp/mydata.txt";
var str = DWfile.read(fileURL);
if (str){
alert(fileURL + " contains: " + str);
}
DWfile.remove()
Availability
Dreamweaver 3.
Description
This function deletes the specified file.
Arguments
fileURL
• The
argument, which is expressed as a file:// URL, is the file you want to remove.
fileURL
Returns
A Boolean value:
value if the operation succeeds;
true
Example
The following example uses the
the
function to display a Yes/No dialog box to the user:
confirm()
function deleteFile(){
var delAnyway = false;
var selIndex = document.theForm.menu.selectedIndex;
value if the read fails.
null
false
DWfile.getAttributes()
otherwise.
function to determine whether the file is read-only and
DREAMWEAVER CS3
12
API Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents