首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >允许pdf上传elfinder

允许pdf上传elfinder
EN

Stack Overflow用户
提问于 2016-04-05 18:36:47
回答 1查看 3K关注 0票数 3

我正在尝试配置elfinder插件,以便允许上传PDF文件,但无法。

错误:不允许这种类型的文件。

我的代码:

代码语言:javascript
复制
$opts = array(
    'roots' => array(
            array(
                'driver' => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
                'path' => '../files/' . $id . '/',                 // path to files (REQUIRED)
                'URL' => dirname($_SERVER['PHP_SELF']) . '/files/' . $id . '/', // URL to files (REQUIRED)
                'uploadDeny' => array('all'),                // All Mimetypes not allowed to upload
                'uploadAllow' => array('image', 'text/plain', 'application/pdf'),// Mimetype `image` and `text/plain` allowed to upload
                'uploadOrder' => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
                'accessControl' => 'access',                     // disable and hide dot starting files (OPTIONAL)
                'uploadMaxSize' => '10M'    
        )
    )
);

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2016-04-20 14:01:12

将此数组合并到您的配置uploadAllow中。

array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream')

这是基于Codeigniter mime的mime

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36423978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档