I am using CodeIgniter to upload some files through a form. I know how to translate “regular” form errors (required, valid_email, etc) but I don’t know how to do it with file errors (file is not allowed, file is too big, etc).
Which keys should I use in
$this->form_validation->set_message('KEY', 'TRANSLATION');
?
Thanks
METHOD 1
By default, language files are typically stored in
system/languagedirectory. Alternately you can create a file calledupload_lang.phpinside yourapplication/languagefolder and store them there.METHOD 2
You can use Flashdata after upload process.
You can also check the problem with
$this->upload->data(). This is a helper function that returns an array containing all of the data related to the file you uploaded. Here is the array prototype :