I use JFileUpload & JSApi with the following scenario:
1. The User chooses an Folder to Upload
2. When JSTransferTriggered is fired i look for an .html file in the folder
3. If there isn't any .html file I want to cancel the whole Upload.
When Cancel is Triggert the TaskBar shows me "Upload Cancled" but the Files are all uploaded.
My Code:
Code: Select all
function JSTransferTriggered(filelist) {
var reEx = new RegExp(/\.html/i);
if(!filelist.match(reEx)) {
document.fileupload.cancel();
$("#statusMsg").append("No *.html file found. Upload canceled<br/>");
}
}