CodeIn House

  • Laravel
  • WordPress
  • jQuery
  • Javascript
  • Contact
Home   Laravel   How to Integrate Responsive File Manager in CK-Editor In Lar ...

How to Integrate Responsive File Manager in CK-Editor In Laravel for Image and File Upload ?

March 9, 2017 by SNK 2

In this tutorial we are going to integrate responsive file manager in ckeditor in laravel. Laravel file manager makes us easy to upload files and images directly into the server by drag and drop feature from ckeditor image upload button.

If you followed by previous tutorial regarding how to integrate CK-Editor 4 in Laravel this would be a next part series of the same tutorial that i recently wrote.  If you haven’t read that post then you might want to take a look at that.

Learn : How to Integrate CK-Editor in Laravel – Laravel CK-Editor Tutorial.

Lets get started :-

What we are going to do ?

  1. Download responsive file manager from their official website.
  2. Integrate responsive file manager into ck-editor.

To know little more about responsive file manager is that, its free and open source & can be easily be integrated with editors like tinymce, CLEditor and CK-Editor. We can freely use it in our commercial projects giving them their credit.

Step 1 :-

Extract responsive file manager zip package into ckeditor folder inside your public folder of laravel project. Your folder structure of ckeditor would look like the image below.

folder structure of ckeditor inside public folder in laravel

Make sure your have exactly kept in this same structure else you might have to change the URLS according to the folder structure you have extracted files into.

Step 2:-

Lets get back where we left off in previous post in integrating ckeditor in laravel. If you check our index.blade.php this is the last code we will see at the end of index.blade.

index.blade.php
PHP
1
2
3
4
5
6
<script>
var ckview = document.getElementById("ckview");
CKEDITOR.replace(ckview,{
language:'en-gb'
});
</script>

Now, we will add the file manager code so that browse server button will appear so that we can browse through images in ckeditor. Just replace the above code with the code provided below.

index.blade.php
PHP
1
2
3
4
5
6
7
8
9
<script>
var ckview = document.getElementById("ckview");
CKEDITOR.replace(ckview,{
language:'en-gb',
filebrowserBrowseUrl : '{{url("ckeditor")}}/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserUploadUrl : '{{url("ckeditor")}}/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserImageBrowseUrl : '{{url("ckeditor")}}/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>

Step 3:-

Now, its time to set the image path for editor. Open config.php file inside public/ckeditor/config/ and go to line 76.

change line number 76 inside config.php in file manager config folder

 Change the code of line number 76 with the code below :-

config.php
PHP
1
2
3
4
5
6
7
8
9
10
11
*/
'upload_dir' => getenv('APP_ROOT_PATH').'/public/ckeditor/source/',
/*
|--------------------------------------------------------------------------
| relative path from filemanager folder to upload folder
|--------------------------------------------------------------------------
|
| with final /
|
*/
'current_path' => '../source/',

Thats, it once you are done check your editor and browse for images and files. If you any problem feel free to mention them in the comments section.

SHARE ON
Buffer

Enjoyed this article?

Like us on

Laravel ckeditor file and image upload laravel 5.4 file manager laravel file manager

Avatar for SNK

About SNK

Hello Welcome to my Blog. I develop Websites Using Laravel Framwork & WordPress. Get Latest updates on Facebook | Twitter

2 Responses...

  1. Avatar for SNKMukesh Chauhan says

    March 19, 2021 at 5:26 pm

    How can i add responsive filemanager if load ckeditor via cdn link, not on local server.

    Reply
    • Avatar for SNKSNK says

      March 27, 2021 at 10:37 am

      If you are not using package and directly a cdn link. Then you can just add their id and some codes in script. However this tutorial doesnot covers for cdn. But you can find it in their docs. You can contact me if you have trouble integrating via cdn. Please contact through my contact form.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get Connected !! With Us

TOP POSTS

  • How to Setup Spring MVC Project From Scratch in Intellij IDEA ?
  • Spring Configuration Class in JAVA [Class VS XML Config]
  • Annotations Based Configuration in Spring Framework
  • How to Configure Spring Framework with XML Configurations?
  • How to Remove Project Name from URL in JSP Project in Intellij IDEA ?

TUTORIALS TILL DATE

  • September 2022 (6)
  • June 2021 (7)
  • October 2020 (5)
  • September 2020 (6)
  • September 2018 (14)
  • August 2018 (3)
  • July 2018 (4)
  • March 2018 (8)
  • February 2018 (5)
  • January 2018 (1)
  • December 2017 (2)
  • August 2017 (8)
  • May 2017 (1)
  • April 2017 (1)
  • March 2017 (4)
  • February 2017 (3)
  • January 2017 (4)

CATEGORIES

  • Angular (2)
  • CSS3 (3)
  • D3 (3)
  • HTML5 (7)
  • JAVA (11)
  • Javascript (20)
  • jQuery (8)
  • Laravel (35)
  • Others (3)
  • PHP (11)
  • Spring (2)
  • WordPress (10)

Top Categories

  • Angular
  • CSS3
  • D3
  • HTML5
  • JAVA
  • Javascript
  • jQuery
  • Laravel
  • Others
  • PHP
  • Spring
  • WordPress

Get in Touch

DMCA.com Protection Status

Recent Articles

  • How to Setup Spring MVC Project From Scratch in Intellij IDEA ?
  • Spring Configuration Class in JAVA [Class VS XML Config]
  • Annotations Based Configuration in Spring Framework
  • How to Configure Spring Framework with XML Configurations?
  • How to Remove Project Name from URL in JSP Project in Intellij IDEA ?

© 2012-22 CodeIn House.  •  All Rights Reserved.