0
我需要驗證CodeIgniter中的視頻上傳大小限制(在服務器端)。如何驗證視頻上傳文件大小
我想通過數組來驗證這一點:
array('field' => 'd_video',
'label' => 'Doctor Video',
'rules' => 'required|file_allowed_type[media]|upload_max_filesize[3072]')
我需要驗證CodeIgniter中的視頻上傳大小限制(在服務器端)。如何驗證視頻上傳文件大小
我想通過數組來驗證這一點:
array('field' => 'd_video',
'label' => 'Doctor Video',
'rules' => 'required|file_allowed_type[media]|upload_max_filesize[3072]')
根據CI Document應該像如下:
$config['upload_path'] = '/uploads/';
$config['allowed_types'] = 'mpeg|avi|wmv';
$config['max_size'] = '2048'; // File Size in KB
$this->load->library('upload', $config);
$this->upload->initialize($config);
if($this->upload->do_upload('d_video'))
{
// Upload Success
}
else
{
echo $this->upload->display_errors();
}
您是否使用CodeIgniter的[文件上傳類](http://ellislab.com /codeigniter/user-guide/libraries/file_uploading.html)? – jleft