Invalid Filename

I want to add a check for invalid filenames when adding files to the queue.

I added the following code to the fileQueued handler:

for (i=0;i<fileObj.name.length;i++) {
if (fileObj.name.charCodeAt(i) > 127) {
progress.setCancelled();
progress.toggleCancel(false);
progress.setStatus("Non-english characters found in file name.");

break;
}
}

I know that this will not really cancel the file for uploading, but when I replace it with swfu.cancelUpload(fileObj.id); I can't change the status from "Cancelled" to the one above.

Any suggestions on how to do this?

*EDIT*
I forgot to mention that I'm using the latest 2.1 version download and the swf for flash 9.

gyphie's picture

uploadError event

When you cancel the file the uploadError event is triggered. You'll need to handle that event to display what you want.

You could do this by setting some kind of variable flag so you know what kind of cancel it is. Or you could re-run the filename check in uploadError.

yeah.. thanks! I found the

yeah.. thanks! I found the solution in a previous post.
I created an array to store the invalid files and added an event handle for invalid filenames