MT::App::CMS::cms_upload_image
This callback is invoked just after an image has been uploaded. It passes to the handler information about the image that was uploaded so that additional information can be gathered, or additional transformations can be applied to the image.
Input Parameters
- $cb - a reference to the current
MT::Callbackobject handling this event. - $params - a hash ref containing information about the uploaded file.
The following are the keys of the parameter ($params) hash passed into the handler as input:
- File or file - a link to the file on the filesystem
- Url or url - the URL to the file
- Size or size - the size of the file in bytes
- Asset or asset - a reference to the MT::Asset object
- Type or type - the type of asset
- Blog or blog - the blog ID
- Width or width - the width of the image
- Height or height - the height of the image
- ImageType or image_type - the mime type of the image (e.g. jpeg, png, gif, etc.)
Return Value
None.
Example Handler
sub handler {
my ($cb, $params) = @_;
}
This page is part of the Events and Callbacks in Movable Type
- Previous MT::App::CMS::cms_upload_file
Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.