MT::App::CMS::cms_upload_file
This callback is invoked just after a file (not an image) has been uploaded. It passes to the handler information about the file that was uploaded so that additional information can be gathered, or additional transformations can be applied to the file.
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
Return Value
None.
Example Handler
sub handler {
my ($cb, $params) = @_;
MT::Log->log({ message => "user uploaded a file at " . $params->{Url} });
}
- Previous: MT::App::CMS::cms_save_filter.$type
- Next: MT::App::CMS::cms_upload_image
This page was last updated on 2008-10-01, 17:03. [Edit]

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.