Page 1 of 1
Need to check filenames before upload starts
Posted: Thu Nov 04, 2010 1:07 pm
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?
Re: Need to check filenames before upload starts
Posted: Thu Nov 04, 2010 9:33 pm
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.