KCFinder与PDF上传的问题

时间:2014-02-14 14:12:59

标签: php pdf upload kcfinder

我正在尝试使用独立的KCFinder来上传PDF文件和图像。刚刚从他们的网站下载了zip并开始构建“系统”,它与图像完美配合。问题是当我想上传PDF文件时,我收到一个错误:“未知的图像格式/编码”。

注意:当我单独打开KCFinder时,它已经在“images”文件夹而不是“upload”。我知道这可能是原因,但我无法找到如何改变这个......

这是我的config.php:

$_CONFIG = array(
// GENERAL SETTINGS

    'browse.php?lang'=>sv,
    'disabled' => false,
    'theme' => "oxygen",
    'uploadURL' => "upload",
    'uploadDir' => "",

    'types' => array(

    // (F)CKEditor types
        'files'   =>  "",
        'flash'   =>  "swf",
        'images'  =>  "*img",
        'misc'      => "pdf doc docx xls xlsx",

    // TinyMCE types
        'file'    =>  "",
        'media'   =>  "swf flv avi mpg mpeg qt mov wmv asf rm",
        'image'   =>  "*img",
    ),


// IMAGE SETTINGS

    'imageDriversPriority' => "imagick gmagick gd",
    'jpegQuality' => 90,
    'thumbsDir' => ".thumbs",

    'maxImageWidth' => 0,
    'maxImageHeight' => 0,

    'thumbWidth' => 100,
    'thumbHeight' => 100,

    'watermark' => "",


// DISABLE / ENABLE SETTINGS

    'denyZipDownload' => false,
    'denyUpdateCheck' => false,
    'denyExtensionRename' => false,


// PERMISSION SETTINGS

    'dirPerms' => 0755,
    'filePerms' => 0644,

    'access' => array(

        'files' => array(
            'upload' => true,
            'delete' => true,
            'copy'   => true,
            'move'   => true,
            'rename' => true
        ),

        'dirs' => array(
            'create' => true,
            'delete' => true,
            'rename' => true
        )
    ),

    'deniedExts' => "exe com msi bat php phps phtml php3 php4 cgi pl",


// MISC SETTINGS

    'filenameChangeChars' => array(/*
        ' ' => "_",
        ':' => "."
    */),

    'dirnameChangeChars' => array(/*
        ' ' => "_",
        ':' => "."
    */),

    'mime_magic' => "",

    'cookieDomain' => "",
    'cookiePath' => "",
    'cookiePrefix' => 'KCFINDER_',


// THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION SETTINGS

    '_check4htaccess' => true,
    //'_tinyMCEPath' => "/tiny_mce",

    '_sessionVar' => &$_SESSION['KCFINDER'],
    //'_sessionLifetime' => 30,
    //'_sessionDir' => "/full/directory/path",

    //'_sessionDomain' => ".mysite.com",
    //'_sessionPath' => "/my/path",
);

有谁知道我做错了什么?

2 个答案:

答案 0 :(得分:2)

不要使用插入图片。如果你想上传文件(zip pdf .etc),你必须使用INSERT LINK而不是INSERT IMAGE。

但之前,您必须编辑配置。

'types' => array(

    // CKEditor & FCKEditor types
    'files'   =>  "",
    'flash'   =>  "swf",
    'images'  =>  "*img",

    // TinyMCE types
    'file'    =>  "doc pdf zip", // <<<======= HERE, because iam using tinyMCE
    'media'   =>  "swf flv avi mpg mpeg qt mov wmv asf rm",
    'image'   =>  "*img",
)

答案 1 :(得分:0)

1.我下载了ckeditor&#34; Standard Package&#34;。
2.我下载附件&#34;文件浏览器&#34;和#34; Popup&#34;来自ckeditor.com的附加组件。
3.我在&#34; ckeditor / config.js&#34;中设置配置,   config.extraPlugins =&#39; popup,filebrowser&#39;;