Search code examples
c#javascriptasp.netinput-type-filefile-location

Getting full path of the file selected via input file type


From my web page,i just want to browse a video file and then get its full path,so that i can use the path to stream the video file through VLC ,using the command line process.

For this purpose i dropped a file type control into my web page.

After selecting a file,when i check the value of the input field.Then i am only getting the name of the File

i.e If i select a file from my desktop named 1.mov, then the location showed in the default text box with the input file type is C:\Users\xx\Desktop\1.mov

But when i check the value of the input field then it only gives the name of the video file i.e 1.mov

Can anyone give me a suitable work around for this or may be some other way to get the full path of the selected file.

Any help will be appreciated.

Thanks.


Solution

  • You Must have to Upload file on server first, then u can get root path using following method,

    Server.MapPath("~"):It returns the physical path to the root of the application.