Hello, I'm trying to access files in a virtual directory I created in IIS for the first time but am getting weird results.
OS: Windows XP Pro
IIS: 5.1
Development Platform: Visual Studio 2008
Language: C#
Virtual Directory Name: portal
Local Path: C:\digital_communications_report_portal
Default Website Local Path: c:\inetpub\wwwroot
I can download the file at http://localhost/portal/testFile.xlsx without any problem.
I try either of these
string realFilename = Server.MapPath(ResolveUrl("~/portal/testFile.xlsx"));
string realFilename = Server.MapPath(ResolveUrl("localhost/portal/testFile.xlsx"));
and get "C:\Documents and Settings\jjohnson\My Documents\Visual Studio 2008\WebSites\clientsite\localhost\portal\testFile.xlsx" which is my project path with the virtual path slapped on the end and is not a valid path. I try taking the tilde or localhost and I get a "Failed to map the path '/portal/testFile.xlsx'." exception.
Any ideas what I'm doing wrong?