gpt4 book ai didi

javascript - 允许 pdf 上传 elfinder

转载 作者:行者123 更新时间:2023-11-30 06:52:11 26 4
gpt4 key购买 nike

我正在尝试配置 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com