php Elfinder maxFileSize配置

mftmpeh8  于 2023-06-04  发布在  PHP
关注(0)|答案(1)|浏览(84)

我试图在connector.php数组选项中配置elfinder maxfilesize选项,但仍然收到此错误:

File exceeds maximum allowed size.

下面是connector.php中的My Configuration:

$opts = array(
    // 'debug' => true,
    'roots' => array(
        array(
            'driver'        => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
            'path'          => '../files/',                 // path to files (REQUIRED)
            'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
            'uploadDeny'    => array('all'),                // All Mimetypes not allowed to upload
            'uploadAllow'   => array('image', 'text/plain','application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/x-rar-compressed, application/octet-stream','application/zip, application/octet-stream'),// 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' => 1000000,
        )
    )
);

我该如何解决这个问题?
谢谢

8yparm6h

8yparm6h1#

'roots' => array(
            array(
                'uploadMaxSize'=>'200KB',
                'driver' => 'LocalFileSystem',           // driver for accessing file system (REQUIRED)
                'path' => DIR_IMAGE . 'catalog/',                // path to files (REQUIRED)
                'URL' => $domain . 'image/catalog/',
                'tmbPath' => DIR_IMAGE . 'elfinder_tmb',
                'tmbURL' => $domain . 'image/elfinder_tmb/',
                'tmbSize' => 100,
                'tmbCrop' => false,
                'tmbBgColor' => '#ffffff',
                'mimeDetect' => 'internal',
                'defaults' => array('read' => true, 'write' => true/*,'locked'=>true*/),
                'imgLib' => 'auto',
                'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
                'uploadAllow' => array('image/jpeg', 'image/png', 'image/gif', 'image/svg+xml',
                    // "особые" типы древних IE добавил на всякий случай sitecreator
                    'image/pjpeg', 'image/webp', 'image/x-png'),
                'uploadDeny' => array('all'),
                'uploadOrder' => array('allow, deny'),
            )

        )

相关问题