cancel whole upload

Upload core product.
Post Reply
Felix
Posts: 2
Joined: Thu Aug 09, 2012 3:36 pm

cancel whole upload

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

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: cancel whole upload

Post by support »

What about if you move your code in JSTransferStarted?

Felix
Posts: 2
Joined: Thu Aug 09, 2012 3:36 pm

Re: cancel whole upload

Post 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.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: cancel whole upload

Post by support »

Could you send your HTML/JavaScript to support(at)jfileupload(dot)com so we can try to reproduce the problem here?

Post Reply