允许pdf上传elfinder

时间:2016-04-05 10:36:47

标签: javascript php jquery 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'    
        )
    )
);

感谢您的帮助。

1 个答案:

答案 0 :(得分:-1)

将此数组合并到您的config uploadAllow。

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

这个基于Codeigniter mimes的mime

相关问题