<div class="form-group">
<label for='image' class="col-sm-2 control-label">Leader Board</label>
<div class="col-sm-10">
<input id= "txt_lead" type = "text" name="image_lead" class="form-control input-sm" onclick ="javascript:document.getElementById('file_lead').click();">
<input id = "file_lead" type= "file" accept="image/*" name="file_ads_lead" style='visibility: hidden;' onchange="ChangeText(this, 'txt_lead');"/>
<?php echo form_error('image_lead', '<small class="pull-right req">', '</small>');?>
</div>
</div>
<script>
function ChangeText(oFileInput, sTargetID) {
document.getElementById(sTargetID).value = oFileInput.value.replace("C:\\fakepath\\", "");;
}
</script>
I'm trying to identify image size by using $_FILES['file_ads_lead']['temp_name'], but i got nothing.
Any idea why?
ps: input file tag is hidden