Need to check filenames before upload starts

Upload core product.
Post Reply
mo_salih
Posts: 3
Joined: Wed Jul 07, 2010 2:23 pm

Need to check filenames before upload starts

Post by mo_salih »

I am using JfileUpload and JbatchUpload and I have a requirement where I need to make sure that only one file of a certain extension is uploaded in a session. I get the filelist in JSTransferTriggered() but the problem is by that time, the upload already started. Is there a way to pause before upload starts so I can check the extensions of the files and cancel it or display a warning if there are files that don't meet my criteria?

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

Re: Need to check filenames before upload starts

Post by support »

Why not using "whitelist" parameter to make sure only allowed extension are used ?
Also there is a callback that may help:
Enable to following properties in i18n_pane.properties:
js.notification.selection=JSSelectionInfo

Then add the following JavaScript function in your HTML:
function JSSelectionInfo(amount, size)
{
//amount is number of files to transfer;
//size of all files to transfer
}

If you want a callback with all filenames (including the one in folders and subfolders) then we would need to develop a custom feature. You can contact support(at)jfileupload(dot)com.

Post Reply