Skip to content

Validation Before Upload

Before an image is uploaded, the plug-in validates it’s mime-type and image file size. Depending on the validation result, an image upload is initialized or it’s stacked as upload and update error.

:::tip upload and update workflow

The workflow concept is described here, and it can be configured depending on your requirements.

:::

The option imageAllowedTypes restrict what images mime types are allowed to be uploaded using RESTful service.

function( pOptions ){
pOptions.imageAllowedTypes = ["jpeg","jpg"];
return pOptions;
}

The option imageMaxSize restricts maximum image file size to be uploaded using RESTful service.

function( pOptions ){
pOptions.imageMaxSize = 1024*30; // 1024*30 = 30 Kilo Bytes
return pOptions;
}