Interface

ImageUploadConfig (image)

@ckeditor/ckeditor5-image/src/imageupload

interface

The configuration of the image upload feature. Used by the image upload feature in the @ckeditor/ckeditor5-image package.

ClassicEditor
	.create( editorElement, {
		image: {
			upload:  ... // Image upload feature options.
		}
	} )
	.then( ... )
	.catch( ... );

See all editor options.

Filtering

Properties

  • types : Array.<String>

    The list of accepted image types.

    The accepted types of images can be customized to allow only certain types of images:

    // 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/jpeg MIME 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' ]