ImageUploadConfig
interface
The configuration of the image upload feature. Used by the image upload feature in the @ckeditor/ckeditor5-image package.
ClassicEditor
.create( {
attachTo: editorElement,
image: {
upload: ... // Image upload feature options.
}
} )
.then( ... )
.catch( ... );Copy codeSee all editor options.
Properties
types: Array<string>module:image/imageconfig~ImageUploadConfig#typesThe list of accepted image types.
The accepted types of images can be customized to allow only certain types of images:
Copy code// Allow only JPEG and PNG images: const imageUploadConfig = { types: [ 'png', 'jpeg' ] };The type string should match one of the sub-types of the image MIME type. For example, for the
image/jpegMIME type, add'jpeg'to your image upload configuration.Note: This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type recognition and filtering should also be implemented on the server which accepts image uploads.
Defaults to
[ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]