Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Docs: Mentioned the Simple upload adapter in the 'Custom image upload…
Browse files Browse the repository at this point in the history
… adapter' guide. Closes ckeditor5#1891.
  • Loading branch information
oleq committed Aug 1, 2019
1 parent 6069624 commit 0c2124f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/framework/guides/deep-dive/upload-adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ In this guide you will learn the basic concepts of the file upload architecture

While this guide is mainly focused on the image upload (the most common kind of upload), keep in mind that the presented concepts and the API allow developing all sorts of file upload adapters for different file types like PDFs, movies, etc.

<info-box>
If you do not feel like getting through this guide but you want a simple upload adapter that works, check out the {@link features/simple-upload-adapter Simple upload adapter} plugin we implemented for you.
</info-box>

<info-box>
Check out the comprehensive {@link features/image-upload Image upload overview} to learn about other ways to upload images into CKEditor 5.
</info-box>
Expand Down Expand Up @@ -152,13 +156,17 @@ editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => {
In this section, you are going to implement and enable a custom upload adapter. The adapter will use the native [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) to send files returned by the loader to a pre–configured URL on the server, handling the `error`, `abort`, `load`, and `progress` events fired by the request.

<info-box>
Note that this is just an example implementation and `XMLHttpRequest` might not necessarily be the best solution for your application.
If you do not feel like getting through this guide but you want a simple `XMLHttpRequest`–based upload adapter that works, check out the {@link features/simple-upload-adapter Simple upload adapter} plugin we implemented for you. It comes with pretty much the same functionality. Just install it, configure it, and you are ready to go.
</info-box>

Use the provided code snippets as an inspiration for your own custom upload adapter &mdash; it is up to you to choose the technologies and APIs to use. For instance, you may want to check out the native [`fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) that works with `Promises` out of the box.
<info-box>
If the {@link features/simple-upload-adapter Simple upload adapter} is not enough for you and you want a custom upload adapter developed on top this guide, go straight to the [full source code](#the-complete-implementation) and start experimenting.
</info-box>

<info-box>
If you do not want to read through this entire guide, you can simply go and check out the [full source code](#the-complete-implementation) of an `XMLHttpRequest`–based upload adapter that you can use in your application.
Note that this is just an example implementation and `XMLHttpRequest` might not necessarily be the best solution for your application.

Use the provided code snippets as an inspiration for your own custom upload adapter &mdash; it is up to you to choose the technologies and APIs to use. For instance, you may want to check out the native [`fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) that works with `Promises` out of the box.
</info-box>

To start off, define the `MyUploadAdapter` class with its constructor.
Expand Down

0 comments on commit 0c2124f

Please sign in to comment.