Any reason why an error message isn’t being displayed when no file is selected?
CONTROLLER
$this->form_validation->set_rules('userfile','Image','file_required');VIEW
<p class="input_text">
<label for="userfile">Select Photo</label>
<input type="file" name="userfile" id="userfile" />
<?php if (form_error('userfile')): echo '<span class="error">'.form_error('userfile').'</span>'; endif; ?>
</p>
I have the same problem as this. It’s weird that when you use
<?php echo validation_errors(); ?>
the error is there.
I used this dirty hack for the time being:
<?php if(strpos(validation_errors(), "No file selected") !== false) { echo '<p>No file selected</p>'; } ?>
And placed it just underneath
<?php echo form_error('userfile') ?>
. This way all the other errors work fine.
