FileUploder get file full path using jquery

与世无争的帅哥 提交于 2021-02-08 04:44:37

问题


I use below code for getting full file path

My problem is using file.value in firefox only get my file name but in ie it get file full path

 function setImage(file) {        
        document.getElementById('prevImage').src = file.value;        
}
  <asp:FileUpload ID="fup" runat="server" onchange="setImage(this);" />
  <img id="prevImage" height="200" width="200"></img>

回答1:


<inpu type="file" /> is a one of those elements which most browser even wont enable to change the style because of the security implications. Each browser has it's own level of security implementation.

I don't know why IE is providing you the full path, when the website to which it is uploading does not need that information

I don't see a reason why you may want the users file location(full path) on the server side, and it is a good thing that firefox is not providing the full path.



来源:https://stackoverflow.com/questions/8147317/fileuploder-get-file-full-path-using-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!