# ckeditor5-ice-upload

> forked from https://github.com/pourquoi/ckeditor5-simple-upload

Latest version **1.0.4** (published 2019-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ckeditor5-ice-upload
pnpm add ckeditor5-ice-upload
yarn add ckeditor5-ice-upload
bun add ckeditor5-ice-upload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-04-09 |
| First published | 2019-01-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | winter-ice |
| Maintainers | winter-ice |
| Keywords | ckeditor5, image |

## Links

- npm: https://www.npmjs.com/package/ckeditor5-ice-upload
- Repository: https://github.com/winter-ice/ckeditor5-ice-upload
- Homepage: https://github.com/winter-ice/ckeditor5-ice-upload#readme
- Issues: https://github.com/winter-ice/ckeditor5-ice-upload/issues
- npm.io page: https://npm.io/package/ckeditor5-ice-upload

## Dependencies (3)

- [@ckeditor/ckeditor5-core](https://npm.io/package/@ckeditor/ckeditor5-core.md) ^10.0.0
- [@ckeditor/ckeditor5-engine](https://npm.io/package/@ckeditor/ckeditor5-engine.md) ^10.0.0
- [@ckeditor/ckeditor5-upload](https://npm.io/package/@ckeditor/ckeditor5-upload.md) ^10.0.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2019-04-09
- 1.0.3 — 2019-04-09
- 1.0.2 — 2019-04-09
- 1.0.1 — 2019-01-19
- 1.0.0 — 2019-01-19

## README

## notice
this package is forked from https://github.com/pourquoi/ckeditor5-simple-upload

there is the change:

1. change `xhr.withCredentials = true` to `xhr.withCredentials = false`
2. change  `data.append('upload', this.loader.file)` to ` data.append('file', this.loader.file);`
## standard image upload button

### build integration

https://docs.ckeditor.com/ckeditor5/latest/builds/guides/development/custom-builds.html

```npm install ckeditor5-ice-upload```

add this plugin and remove the ckfinder and easyimage plugins

```javascript
// build-config.js

module.exports = {
	// ...
	
	plugins: [
        '@ckeditor/ckeditor5-essentials/src/essentials',
        // ...

        //'@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter',
        //'@ckeditor/ckeditor5-easy-image/src/easyimage',

        'ckeditor5-ice-upload/src/iceupload'

        // ...
    ],

    // ...

    config: {
        toolbar: {
            items: [
                'headings',
                'bold',
                'italic',
                'imageUpload',
                'link',
                'bulletedList',
                'numberedList',
                'blockQuote',
                'undo',
                'redo'
            ]
        },
        // ...
    }
}
        
```

### configuration

```javascript
ClassicEditor.create(document.querySelector( '#editor' ), {
    iceUpload: {
        uploadUrl: 'http://127.0.0.1/my-upload-endpoint'
    }
})
```

```javascript
var cb = function() { return (new Date()).getTime() }
ClassicEditor.create(document.querySelector( '#editor' ), {
    iceUpload: {
        uploadUrl: {url:'http://127.0.0.1/my-upload-endpoint', headers:{ 'x-header':'myhead', 'x-header-cb': cb } }
    }
})
```

### backend

the endpoint will receive a file named **upload** and should return the image url

success response :
```json
{
    "uploaded": true,
    "url": "http://127.0.0.1/uploaded-image.jpeg"
}
```

failure response :
```json
{
    "uploaded": false,
    "error": {
        "message": "could not upload this image"
    }
}
```

---
_Source: https://npm.io/package/ckeditor5-ice-upload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
