Skip to content

Instantly share code, notes, and snippets.

@mariuswilms
Created January 21, 2009 06:58
Show Gist options
  • Select an option

  • Save mariuswilms/49878 to your computer and use it in GitHub Desktop.

Select an option

Save mariuswilms/49878 to your computer and use it in GitHub Desktop.
<?php
class Movie extends AppModel {
var $actsAs = array('Media.Transfer');
var $validate = array(
'file' => array(
'resource' => array('rule' => 'checkResource'),
'access' => array('rule' => 'checkAccess'),
'location' => array('rule' => array('checkLocation', array(MEDIA_TRANSFER, '/tmp/'))),
'permission' => array('rule' => array('checkPermission', '*')),
'size' => array('rule' => array('checkSize', '5M')),
'pixels' => array('rule' => array('checkPixels', '1600x1600')),
'extension' => array('rule' => array('checkExtension',
array('bin', 'class', 'dll', 'dms', 'exe', 'lha'),
'*'
),
'mimeType' => array('rule' => array('checkMimeType', false, '*')),
));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment