作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试配置 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('应用程序/pdf',
'应用程序/强制下载',
'应用程序/x-下载',
'二进制/八位字节流')
这是基于 Codeigniter mime 的 mime
关于javascript - 允许 pdf 上传 elfinder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36423978/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!