J.P.A.L.

 

getAllFiles

Page history last edited by vietmusic 2 yrs ago

getAllFiles

 

An encapsulation of the API GetAllFiles function, passing an object containing an array of all files to the specified handler function.

 

jpal.getAllFiles(handler);

 

handler is the function that receives the object. The property files will contain the array of file names if successful. Otherwise, error and errCode will be set.

 

Example:

 

document.write('<div id="files"></div>'); //container for file list
function outputFileList(obj) {
if (obj.error && obj.errCode) {
alert('Error ' + obj.errCode + ': ' + obj.error);
return;
}
if (obj.files) {
var html = '';
for (var i=0; i<obj.files.length; i++) {
html += obj.files[i] + '<br />';
}
document.getElementById('files').innerHTML = html;
}
}
jpal.getAllFiles(outputFileList);

Comments (0)

You don't have permission to comment on this page.