Pergunta

I am trying to use standalone KCFinder to upload PDF files and images. Just downloaded the zip from their website and started to build up the "system" and it works perfect with images. The problem is when I want to upload PDF files, I get an error: "Unknown image format/encoding".

NOTE: When I open my KCFinder standalone it is already on the folder "images" and not "upload". I know this can be the cause but I can't find out how to change this...

Here is my 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",
);

Does anyone know what I am doing wrong?

Foi útil?

Solução

dont use insert image. if you want to upload file (zip pdf .etc), you must use INSERT LINK rather than INSERT IMAGE.

but before, you must edit the config.

'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",
)

Outras dicas

1.I download the ckeditor "Standard Package".
2.I download the add-ons "File Browser" and "Popup" from the add-ons part of ckeditor.com.
3.I set the config in "ckeditor/config.js", config.extraPlugins = 'popup,filebrowser';

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top