how to get the full path in <input type="File"/> when we use JS??? RRS feed

  • Question

  • 1. I use <input type="file" id="UploadFile" />  to upload file , and I want to get the full path, just like "C:\Users\Desktop/File.xls" and not "C:/fakepath/File.xls". I want to use JS get the full path. Can you help me resolve this issue? and I first thanks at this moment. Thanks.
    Thursday, July 9, 2015 2:28 PM


  • Hi guangwen,

    Javascript can't get the file's full path on the client computer, this is for the sake of security. You could try the HTML5 features, it's possible to get the full name of the file with some HTML5 functions, but it does not work for all the web browsers as far as I know.

    By the way, this forum is not the right place for Javascript questions. Please post in the Javascript section in the ASP.NET forums:


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 10, 2015 6:56 AM