[eluser]Salim[/eluser]
Hi,
I'm using CI validation with MY_form_helper.php.
In my form, I have an
.
To generate it, I have modified the helper MY_form_helper, adding this function to generate the input file.
Code:
function form_input_file($data = '', $value = '', $extra = '')
{
$name = ( ! is_array($data))?$data:((isset($data['name']))?$data['name']:'');
$value = (isset($_POST[$name]))?$_POST[$name]:((isset($_GET[$name]))?$_GET[$name]:$value);
$defaults = array('type' => 'file', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value, 'maxlength' => '500', 'size' => '50');
return "<input ".parse_form_attributes($data, $defaults).$extra." />\n";
}
I just have modified the 'type' => 'file'...
Unfortunately, after validation, the value of the input file is not saved ...
Does anyone have a solution ??
Thanks in advance,