Can't get value of input type=“file”?

后端 未结 8 2088
谎友^
谎友^ 2020-11-27 16:48

I have a

When I\'m using: alert($(\"#uploadPicture\").val());

It ale

8条回答
  •  醉酒成梦
    2020-11-27 17:13

    You can get it by using document.getElementById();

    var fileVal=document.getElementById("some Id");
    alert(fileVal.value);
    

    will give the value of file,but it gives with fakepath as follows

    c:\fakepath\filename
    

提交回复
热议问题