Page 1 of 1

cancel whole upload

Posted: Thu Aug 09, 2012 3:44 pm
by Felix
Hey there,

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/>");
	}
}

Re: cancel whole upload

Posted: Sun Aug 12, 2012 10:27 am
by support
What about if you move your code in JSTransferStarted?

Re: cancel whole upload

Posted: Sun Aug 12, 2012 5:08 pm
by Felix
That doesnt really point my needs.

If i put it in JSTransferStarted i just have that actual file as parameter. If the folder consits of 50 files and the last one is the .html the user have to upload 49 files until the error occurs.

Re: cancel whole upload

Posted: Fri Aug 17, 2012 7:29 am
by support
Could you send your HTML/JavaScript to support(at)jfileupload(dot)com so we can try to reproduce the problem here?