Sign up (with export icon)

ImageUploadConfig

Api-interface icon 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( ... );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    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' ]
    };
    
    Copy code

    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' ]