$post = Validate::factory(array_merge($_POST, $_FILES));
$post->rule('building_id', 'numeric');
$post->rule('building_file', 'Upload::not_empty', array());
$post->rule('building_file', 'Upload::valid', array());
$post->rule('building_file', 'Upload::type', array(array('xls', 'xlsx')));
$post->rule('building_file', 'Upload::size', array('1M'));
$view = View::factory('saveresponseplainview');
$response_str = '';
if ($post->check())
{
//ok
}
else
{
//error
}
$post = Validate::factory(array_merge($_POST, $_FILES))
->rule('building_id', 'numeric')
->rules('building_file', array(
'Upload::not_empty' => NULL,
'Upload::valid' => NULL,
'Upload::type' => array('xls', 'xlsx'),
'Upload::size' => array('1M')
);<form action="/upload/save" enctype="multipart/form-data" method="post"> It looks like you're new here. If you want to get involved, click one of these buttons!