-
Notifications
You must be signed in to change notification settings - Fork 140
fieldOptions-accept not working well #116
Comments
Thanks...yes I found that but how do I set that in your widget settings ? |
And there seems to be alot of validation going on in the bluimp uploadhandler that is missing in your demo implementation... https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php |
The upload handler of jquery file upload certainly doesn't use Yii2 validation capabilities. We need to combine both.
Everything on the plugin documentation can be set throughout |
Cool... I could assume that , but I could not find it. |
when I set it:
I get
|
@robov you need to setup a valid regular expression. Therefore you need to use 'clientOptions' => [
'maxFileSize' => 10000 * $FilesizeGB ,
'maxChunkSize' => 1 * $FilesizeMB,
'maxNumberOfFiles' => 2,
'acceptFileTypes' => new JsExpression('/(\.|\/)(gif|jpe?g|png)$/i'),
], more here: https://github.com/blueimp/jQuery-File-Upload/wiki/Options#acceptfiletypes |
AWESOME... thank you so much please include that in your demo, so other people won't have to struggle finding it.... |
PRs are always welcome |
When I limit the fieldoptions to accept only pdf I get a file select limitation (I can only select pdf from my computer), however when I type in a name xx.zip.. then I can still upload that zip file.
The demo on blueimp has somewhere a check before the upload and prevents uploading the wrong filetype
The text was updated successfully, but these errors were encountered: