本文介绍了ckfinder 3.4.5-上传后仍然创建缩略图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在自定义CMS中使用ckeditor4已有很长时间了,并且我刚刚集成了ckfinder3,因此可以使用drag&通过ckeditor4上传图片.一切正常,上传时我调整了图像的大小(在ckfinder/config.php中设置)-一切都很好.

I've been using ckeditor4 for ages in my custom CMS and I've just integrated ckfinder3 so I can use drag & drop image uploading via ckeditor4. Everything is working properly and I have it resizing images upon upload (set in ckfinder/config.php) - all good.

我的问题是,我也希望它也像过去一样创建图像的缩略图(我一直在使用ckfinder的早期版本).它们曾经被上传到userfiles/_thumbs/images/,但是现在似乎没有.

My issue is I want it to create a thumbnail of the image too, as it did in the past (I've been using an earlier version of ckfinder). They used to be uploaded to userfiles/_thumbs/images/ but now it doesn't seem to do it.

我为编辑器设置了一些自定义位,例如自定义配置文件和自定义contents.css,但它们对此没有任何影响.下面是我在CMS中的编辑器代码,所有内容都很简单明了,除了使用拖放功能上传图片外,所有内容都可以正常使用.拖放也不会创建缩略图.

I have a few custom bits set up for my editor such as a custom config file and custom contents.css but they shouldn't have any effect on this. My editor code from within my CMS is below, all pretty straightforward stuff and it all works except for the fact that uploading images using drag & drop doesn't create a thumbnail too.

要注意的一点是,如果单击ckeditor工具栏上的图像"按钮,然后以通常的方式上载-浏览服务器/上载等,则系统会创建缩略图并将其放在以下文件夹中:userfiles/.ckfinder/cache/thumbs/images/theUploadedImage/theUploadedImage.jpg

A point to note that if clicking on the 'image' button on the ckeditor toolbar, then uploading the usual way - browse server/upload etc, the system does create a thumbnail and places it in the folder here: userfiles/.ckfinder/cache/thumbs/images/theUploadedImage/theUploadedImage.jpg

任何指针将不胜感激.我希望这是有道理的!谢谢

Any pointers would be gratefully received. I hope this makes sense!Thanks

<textarea name="blog_text"></textarea>
<script>
    CKEDITOR.replace( 'blog_text', {

        customConfig: 'mycustomfolder/myconfig.js',
        contentsCss: CKEDITOR.getUrl( 'mycustomfolder/mycontents.css' ),

        filebrowserBrowseUrl: 'ckfinder3.4.5/ckfinder.html',
        filebrowserImageBrowseUrl: 'ckfinder3.4.5/ckfinder.html?type=Images',
        filebrowserUploadUrl: 'ckfinder3.4.5/core/connector/php/connector.php?command=QuickUpload&type=Files',
        filebrowserImageUploadUrl: 'ckfinder3.4.5/core/connector/php/connector.php?command=QuickUpload&type=Images'

    } );
</script>

推荐答案

在CKFinder 3中更改了路径和创建方法.假设您使用的是默认配置,则所有缩略图都将在/userfiles中创建/.ckfinder/cache/thumbs/文件夹,并且仅供CKFinder私人使用.实际上,它们也供CKF 2.x专用,但用户喜欢滥用它.

The paths and the methods of creating them were chnaged in CKFinder 3. Assuming that you are using default configuration, all thumbnails are being created inside /userfiles/.ckfinder/cache/thumbs/ folder and are on CKFinder private use only. They actually were for private use in CKF 2.x as well but users liked to abuse that.

如果使用,也会创建缩略图,可在Popup和CKEditor集成中使用选择比例"选项.在这种情况下,缩放后的图像会在/MainFilesFolder/resourceTypeFolder/__ thumbs/NameOfImage.extension/NameOfImage__widthxheight.extension 中创建./userfiles/images/__ thumbs/Students.jpg/Students__480x320.jpg .

Thumbnails get also created if you use, available in Popup and CKEditor integrations, "Choose Scaled" option. In that case scaled image gets created inside /MainFilesFolder/resourceTypeFolder/__thumbs/NameOfImage.extension/NameOfImage__widthxheight.extension e.g. /userfiles/images/__thumbs/Students.jpg/Students__480x320.jpg.

您可以通过 https:/来稍微更改私有目录的位置/ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_privateDir ,但请注意,路径 resourceTypeName/theUploadedImage/theUploadedImage.jpg 的结尾不会更改.

You can somewhat change the location of private directory through https://ckeditor.com/docs/ckfinder/ckfinder3-php/configuration.html#configuration_options_privateDir but please note that end of path resourceTypeName/theUploadedImage/theUploadedImage.jpg will not change.

在线上也有一个简单的插件,可让您在上传文件时产生拇指.也许这可能适合您,或者可以用作创建自己的自定义插件的起点: https://gist.github.com/zaak/7bb61025bfd9d3a6633029b0b4b087f9 .

There is also a simple plugin available online which allows generating thumbs on file upload. Perhaps this is something that might suit you or something that can be used as a jump start to create your own custom plugin: https://gist.github.com/zaak/7bb61025bfd9d3a6633029b0b4b087f9.

这篇关于ckfinder 3.4.5-上传后仍然创建缩略图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 09:59