Search code examples
asp.nethtmlinputfile-type

Problem getting the full path of the file uploaded using HTML inputfile type to read the content of the file


I would like to use HTML input file type in my aspx page to allow user to browse for a excel file and then read the content of the excel sheet programmatically.If I want to read the excel sheet I need the full path of the file to connect to the excel sheet using asp.net.I do not understand how can I get the full path of the file.

I know I can get the filename using postedFile.FileName property.But I need the full path of the file.

Could someone please help me with that.

Thanks.


Solution

  • There's no such notion as full path of the file. The server has no way of knowing where the file is stored on the client computer. All that you can know in your ASP.NET application is the filename and the contents of the uploaded file.