Came across other day the need to upload pdf files through the WYSIWYG tool on Magento. I’ve checked the native functionality and it allows by default only images (jpg, png, gif).
So, to change the initial behavior I opened the file app/code/core/Mage/Cms/etc/config.xml, which defines the filetypes that can be uploaded, and around line 110 I’ve added the line
<allowed> <jpg>1</jpg> <jpeg>1</jpeg> <png>1</png> <gif>1</gif> <pdf>1</pdf> </allowed>
You should also change the your code as below if you want the Image Button on the WYSIWYG enable:
<image_allowed> <jpg>1</jpg> <jpeg>1</jpeg> <png>1</png> <gif>1</gif> <pdf>1</pdf> </image_allowed>
Here we enabled .pdf, however keep in mind that it can also be done for any other kind of extension.
1 Comment
Immanuel Pekerti · October 2, 2016 at 12:37 am
Would this trick work for Magento 2 (v2.1.0 specifically)?
If not, would you know a way to allow PDFs on M2’s WYSIWYG’s tool?
Thanks in advance.