• 欢迎访问magento4you博客,我们提供magento建站、技术咨询、IT运维、支持培训、二次开发服务及模板定制,联系QQ:283475615
  • Magento入门教程 二次开发 模板定制 联系QQ:283475615
  • magento运营 SEO SEM 数字营销 广告竞价 联系QQ:283475615
  • 如果您觉得本站对你有帮助,那么赶紧使用Ctrl+D 收藏吧!

magento2 支持pdf文件上传

magento教程 magento4you 4年前 (2017-02-12) 915次浏览

通过修改app/code/YOUR_MODULE/YOUR_PACKAGE/etc/di.xml文件 ,添加<item name="pdf" xsi:type="number">1</item>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xmlversion="1.0"?>
<configxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <typename="Magento\Cms\Model\Wysiwyg\Images\Storage">
        <arguments>
            <argumentname="resizeParameters"xsi:type="array">
                <itemname="height"xsi:type="number">75</item>
                <itemname="width"xsi:type="number">100</item>
            </argument>
            <argumentname="extensions"xsi:type="array">
                <itemname="allowed"xsi:type="array">
                    <itemname="jpg"xsi:type="number">1</item>
                    <itemname="jpeg"xsi:type="number">1</item>
                    <itemname="png"xsi:type="number">1</item>
                    <itemname="gif"xsi:type="number">1</item>
                    <itemname="pdf"xsi:type="number">1</item>
                </item>
                <itemname="image_allowed"xsi:type="array">
                    <itemname="jpg"xsi:type="number">1</item>
                    <itemname="jpeg"xsi:type="number">1</item>
                    <itemname="png"xsi:type="number">1</item>
                    <itemname="gif"xsi:type="number">1</item>
                </item>
                <itemname="media_allowed"xsi:type="array">
                    <itemname="flv"xsi:type="number">1</item>
                    <itemname="swf"xsi:type="number">1</item>
                    <itemname="avi"xsi:type="number">1</item>
                    <itemname="mov"xsi:type="number">1</item>
                    <itemname="rm"xsi:type="number">1</item>
                    <itemname="wmv"xsi:type="number">1</item>
                    <itemname="pdf"xsi:type="number">1</item>
                </item>
            </argument>
            <argumentname="dirs"xsi:type="array">
                <itemname="exclude"xsi:type="string"/>
                <itemname="include"xsi:type="string"/>
            </argument>
        </arguments>
    </type>
</config>

 

最后清除缓存

php bin/magento cache:clean

极客公园 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:magento2 支持pdf文件上传
喜欢 (0)