You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried adding $uploadField->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif')); to a Basic UploadField, and when I tried to upload a PDF, it correctly reported "Extension 'pdf' is not allowed".
But when I try and add this same restriction to the BulkUploader field, using $bulkUpload->setUfSetup('setAllowedExtensions', array('jpg', 'jpeg', 'png', 'gif')); it still accepts and uploads a PDF file.
So it does look like this issue is specific to BulkUploader.
I've delved into this a bit more, but can't work it out. It does seem like setFolderName is handled in a different place to setAllowedExtensions but I can't work out the intricacies of UploadField, UploadReceiver, FileUploadReceiver, FileField, FileHandleField etc to be able to work out what needs to change in BulkUploader to fix the validation failing to work.
I'm trying to add simple file type validation to the BulkUploader, but can't get it to work.
I've tried:
$bulkUpload->setUfSetup('setAllowedFileCategories', 'image/supported');
and also:
$bulkUpload->setUfSetup('setAllowedExtensions', ['jpg', 'jpeg', 'png', 'gif']);
But despite
$bulkUpload->setUfSetup('setFolderName','XXX');
working fine, the above settings don't appear to have any effect.Am I doing something wrong?
The text was updated successfully, but these errors were encountered: