Get filename from input [type='file'] using jQuery

前端 未结 11 1033
陌清茗
陌清茗 2020-12-23 20:15

This is the uploaded form.

11条回答
  •  死守一世寂寞
    2020-12-23 20:24

    There is no jQuery function for this. You have to access the DOM element and check the files property.

    document.getElementById("image_file").files[0];
    

    Or

    $('#image_file')[0].files[0]
    

提交回复
热议问题