prova nel tuo input type file ha mettere anche un id con lo stesso nome
<input type="file" name="foto" id="foto">