enctype="multipart/form-data"
<input type="file" name="XXX" >
<input id="file" type="file" class="form-control" accept="image/*" >
<input type="file" name="pic" id="pic" accept="image/gif, image/jpeg" />
$ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);