Well, my problem is that image is not uploaded to server but after choosing image in text editor and adding it in field i cant see this image too.
My code:
import Quill from 'quill';
import {
ImageUpload
} from 'quill-image-upload';
Quill.register('modules/imageUpload', ImageUpload);
const quill = new Quill(editor, {
theme: 'snow',
modules: {
toolbar: '#toolbar',
imageUpload: {
url: 'http://localhost:3000', // server url. If the url is empty then the base64 returns
method: 'POST', // change query method, default 'POST'
name: 'image', // custom form name
withCredentials: false, // withCredentials
headers: {}, // add custom headers, example { token: 'your-token'}
csrf: {
token: 'token',
hash: ''
}, // add custom CSRF
customUploader: () => {}, // add custom uploader
// personalize successful callback and call next function to insert new url to the editor
callbackOK: (serverResponse, next) => {
next(serverResponse);
},
// personalize failed callback
callbackKO: serverError => {
alert(serverError);
},
// optional
// add callback when a image have been chosen
checkBeforeSend: (file, next) => {
console.log(file);
next(file); // go back to component and send to the server},
}
}
}
});
var form = document.querySelector('form');
form.onsubmit = function () {
// Populate hidden form on submit
var about = document.querySelector('input[name=body]');
about.value = JSON.stringify(quill.root.innerHTML);
};
Well, my problem is that image is not uploaded to server but after choosing image in text editor and adding it in field i cant see this image too.
My code:
Frontend
Any suggestions everything else works fine.