I have got a excel sheet (.xls) in my app_data folder and when I access the website on IE the path is shown as:
c:\inetpub\wwwroot\App_Data\Book2.xls
however when I access on the localhost it is shown as:
\\webserver\webserver\project\App_Data\Book1.xls (which is the correct path)
The correct path is only shown on the localhost. Could someone help me out?
Both of them are correct but are different – and none of this is correct for use on web.
When you access it with IE as
c:\then the IE actually is not a browser any more but a file manager.When you access it with IE as
\\webserver\then IE actually work as network browsers. In a local network this can work, but the connection is done from MS network access layer and not from the web iis.In both cases IE is not acting as web browser. IE have advertised that is together all this 3, file browser, network browser and web browser (and maybe photo browser and other).
Because you use IE not means that behind the IE use the same code for all cases. Not, its not, IE use different access method for the 3 cases.
Note
None of this are correct for the web !. And actually you can not share data on the app_data directory because is a protected directory from asp.net.
a correct directory for the web is like
http://www.yoursite.com/directory/book.xlswhere the book.xls is under thec:\inetpub\wwwroot\directory\