【问题标题】:KCFinder issue with PDF uploadsPDF 上传的 KCFinder 问题
【发布时间】:2014-02-14 14:12:59
【问题描述】:

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

注意:当我独立打开我的 KCFinder 时,它已经在文件夹“图像”而不是“上传”中。我知道这可能是原因,但我不知道如何改变它...

这是我的 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",
);

有谁知道我做错了什么?

【问题讨论】:

    标签: php pdf upload kcfinder


    【解决方案1】:

    不要使用插入图片。如果要上传文件(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",
    )
    

    【讨论】:

      【解决方案2】:

      1.我下载了ckeditor“标准包”。
      2.我从ckeditor.com的插件部分下载插件“文件浏览器”和“弹出窗口”。
      3.我在“ckeditor/config.js”中设置配置, config.extraPlugins = 'popup,filebrowser';

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-08-22
        • 1970-01-01
        • 2020-01-25
        • 2011-08-04
        • 2015-08-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多