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 <pdf>1</pdf>as below:

<allowed>
<jpg>1</jpg>
<jpeg>1</jpeg>
<png>1</png>
<gif>1</gif>
  <pdf>1</pdf>
</allowed>

Clean your Cache Management > Configuration, then you can open again your WYSIWYG (which can be done through CMS > Pages > Select One Page > Tab Content) and click on the bottom “Insert Image” (as below) and you show be able to upload your pdfs by now.

wysiwyg

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>

This changes will affect the button in the image:

wysiwyg_02

Here we enabled .pdf, however keep in mind that it can also be done for any other kind of extension.

Source:

http://blog.mdnsolutions.com/index.php/enable-pdf-extension-on-wysiwyg-for-magento/
0 Likes
1667 Views

You may also like

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter message.