The
constraint
(return only folders). If it is omitted, the function returns files and
"directories"
folders.
Returns
An array of strings that represents the contents of the folder.
Example
The following code gets a list of all the text (TXT) files in the C:/temp folder and displays the
list in an alert message:
var folderURL = "file:///c|/temp";
var fileMask = "*.txt";
var list = DWfile.listFolder(folderURL + "/" + fileMask, "files");
if (list){
alert(folderURL + " contains: " + list.join("\n"));
}
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);
}
24
The File I/O API
argument, if it is supplied, must be either
"files"
value if the read fails.
null
(return only files) or
Need help?
Do you have a question about the DREAMWEAVER 8-DREAMWEAVER API and is the answer not in the manual?