Image upload overview
Inserting images into content created with CKEditor is a very common task. In a properly configured editor, there are several ways for the end user to insert images:
- Pasting it from the clipboard.
- Dragging a file from the file system.
- Selecting it through a file system dialog.
- Selecting it from a media management tool in your application.
Excluding the last option, all other ways require the image to be uploaded to a server which will be the one responsible for providing the image URL used by CKEditor to display the image in the document.
The software that makes the image upload possible is called an upload adapter. It is a callback which tells the editor how to send the file to the server. There are two main strategies of getting the image upload work you can adopt in your project:
- Official upload adapters: There are several features providing upload adapters developed and maintained by the CKEditor team. Pick the best one for your integration and let it handle the image upload in your project.
- Custom upload adapters: Create your own upload adapter from scratch using the open API architecture CKEditor 5 provides.
If you want to get a better look under the hood and learn more about the upload process, you can check out the “Custom image upload adpter” deep dive guide covering that topic.
# Demo
The demo below uses the Classic editor configured to use the Easy Image service provided by CKEditor Cloud Services:
Paste or drop an image directly into the editor. You can also use the "Insert image" button in the toolbar.
# Official upload adapters
# Easy Image
CKEditor 5 introduces a totally new way of handling images, with strong focus on the end–user experience. It is called Easy Image and its goal is to make the image upload as effortless and intuitive as possible.
Easy Image is part of the CKEditor Cloud Services offer. It is a SaaS product which:
- securely uploads images,
- takes care of rescaling and optimizing them as well as providing various image sizes (responsive images),
- delivers uploaded images through a blazing-fast CDN.
All that, with virtually zero server setup.
Learn how to use Easy Image in your project.
# CKFinder
The CKFinder feature provides a bridge between the editor and CKFinder, a browser-based file manager and a server-side connectors (PHP and .NET).
There are two ways you can integrate CKEditor 5 with the CKFinder file manager:
-
With the server-side connector only: In this scenario, images which are dropped or pasted into the editor are uploaded to a CKFinder server-side connector running on your server.
-
With both the server-side connector and client-side file manager (recommended): Images dropped and pasted directly into the editor are uploaded to the server (just like in the first option).
But there are more cool features available, for instance:
- uploading using the full user interface,
- browsing previously uploaded images,
- editing images (cropping, resizing, etc.),
- organizing or deleting images.
Learn how to integrate CKEditor 5 with CKFinder in your project.
# Implementing your own upload adapter
CKEditor 5 provides an open API that allows you to develop your own upload adapters. Tailored to your project, a custom adapter will allow you to take the full control over the process of sending the files to the server as well as passing the response from the server (e.g. the URL to the saved file) back to the editor.
Learn how to develop your own upload adapter for CKEditor 5.