允许pdf上传elfinder



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

错误:不允许使用此类文件。

我的代码:

$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'    
        )
    )
);

谢谢你的帮助。

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

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

这是基于Codeigniter的mime mimes

相关内容

  • 没有找到相关文章

最新更新