0
我想驗證代碼giniter中的文件上傳字段。我嘗試了下面的代碼,但這不起作用。任何其他方式?如何在代碼點火器中設置文件上傳中的驗證規則
$this->form_validation->set_rules('photo', 'Passport Photo', 'required');
我想驗證代碼giniter中的文件上傳字段。我嘗試了下面的代碼,但這不起作用。任何其他方式?如何在代碼點火器中設置文件上傳中的驗證規則
$this->form_validation->set_rules('photo', 'Passport Photo', 'required');
除了與JavaScript客戶端驗證的,你可以嘗試在你的控制器如下:
if (empty($_FILES['photo']['name']))
{
$this->form_validation->set_rules('photo', 'Passport photo', 'required');
}