如何使用ckeditor上传图像

时间:2014-03-18 13:02:49

标签: php codeigniter

我在CodeIgniter PHP中工作。使用ckeditor我如何上传图片?图像上传按钮已打开,但图像无法在服务器中上传。浏览服务器按钮不起作用。  在我的项目中ckeditor& ckfinder在 - scripts / ckeditor& scripts / ckfinder文件夹。

我的代码:

 <script type="text/javascript" src="<?php echo base_url();?>scripts/ckeditor/ckeditor.js"></script>
 <script type="text/javascript" src="<?php echo base_url();?>scripts/ckfinder/ckfinder.js"></script>

<script type="text/javascript">

     var editor = CKEDITOR.replace( 'ckeditor', {
    filebrowserBrowseUrl : 'scripts/ckfinder/ckfinder.html',
    filebrowserImageBrowseUrl : 'scripts/ckfinder/ckfinder.html?type=Images',
    filebrowserFlashBrowseUrl : 'scripts/ckfinder/ckfinder.html?type=Flash',
    filebrowserUploadUrl : 'scripts/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
    filebrowserImageUploadUrl : 'scripts/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
    filebrowserFlashUploadUrl : 'scripts/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
 });

   CKFinder.setupCKEditor( editor, '../' );
</script>

在config.php文件中的ckfinder文件夹中我改变了这个:

$baseUrl = '/scripts/ckfinder/userfiles/';
$enabled = true;
$config['SecureImageUploads'] = false;

在视图页面中:

<textarea name="content_longdetails" required="1"  tabindex="4" placeholder="Content Long Details" name="ckeditor" id="ckeditor" cols="80"></textarea> <?php echo display_ckeditor($check_editor['ckeditor']); ?>

现在我要上传图片了吗?

0 个答案:

没有答案