Unable to upload PDF in File manager

I'm trying to link to a PDF uploaded via the file manager and I get the error:

Unable to upload "This is a test document.pdf".
File type not allowed.
(application/pdf)

It is in the list in the backend Settings/Campaigns/Attachments
 

Attachments

  • 2020-05-22 10_23_38-.png
    2020-05-22 10_23_38-.png
    81.9 KB · Views: 10
The file manager is very strict, what you can do, create a file called init-custom.php on your server, for mailwizz, in the /apps/ folder and in it, place this content:
PHP:
<?php

Yii::app()->hooks->addFilter('ext_ckeditor_el_finder_options', function($options){
    $options['roots'][0]['uploadAllow'][] = 'application/pdf';
    return $options;
});
(so the file will be /apps/init-custom.php )

Then save the file and try again, this time you should be able to upload pdfs.
 
@twisted1919

Please confirm this code is correct to upload mp4.

Code:
<?php

Yii::app()->hooks->addFilter('ext_ckeditor_el_finder_options', function($options){
    $options['roots'][0]['uploadAllow'][] = 'application/mp4';
    return $options;
});

Really thanks.
 
@twisted1919

Yes, I need to enable mp4 + pdf. So this code is correct to paste on init-custom.php?

PHP:
<?php

Yii::app()->hooks->addFilter('ext_ckeditor_el_finder_options', function($options){
    $options['roots'][0]['uploadAllow'][] = 'application/pdf';
    return $options;
});

Yii::app()->hooks->addFilter('ext_ckeditor_el_finder_options', function($options){
    $options['roots'][0]['uploadAllow'][] = 'video/mp4';
    return $options;
});

Really thanks!
 
Yes, but you can do it in one go:
PHP:
<?php

Yii::app()->hooks->addFilter('ext_ckeditor_el_finder_options', function($options){
    $options['roots'][0]['uploadAllow'][] = 'application/pdf';
    $options['roots'][0]['uploadAllow'][] = 'video/mp4';
    return $options;
});
 
Back
Top