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

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

This is the uploaded form.

11条回答
  •  感情败类
    2020-12-23 20:23

    var file = $('#YOURID > input[type="file"]'); file.value; // filename will be,

    In Chrome, it will be something like C:\fakepath\FILE_NAME or undefined if no file was selected.

    It is a limitation or intention that the browser does not reveal the file structure of the local machine.

提交回复
热议问题