0

I am using a input type file control in my ASP.Net MVC application for uploading a file. The problem with it is that the browser doesn't allow the directory structure to be revealed after selecting a file through it. It shows C:\fakepath\filename.

I have gone through a lot of questions to find an answer to this. All are saying it can't be overridden.

Is there any other control like Telerik or AJAX which I can use to achieve this?

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • According to me you cant get the full path of the file (for security reasons). See this post: https://stackoverflow.com/questions/382464/httppostedfile-filename-different-from-ie – Dimitri Mar 21 '19 at 13:42
  • 3
    The title, about uploading a file without using an `input type="file"`, is different to the question, which is about getting the directory structure on the client. The former is possible, the latter is most definitely not, and if you even need that then you're doing something wrong. – Rory McCrossan Mar 21 '19 at 13:43
  • @RoryMcCrossan This is the requirement. I have to show path in file upload control – Siddharth Ubana Mar 21 '19 at 13:57
  • 2
    I'm afraid you're going to need to change the requirements then, as this isn't possible. – Rory McCrossan Mar 21 '19 at 14:04

0 Answers0