By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,681 Members | 1,775 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,681 IT Pros & Developers. It's quick & easy.

Get the full file path

P: n/a
Ken
I have application files under "C:\$\TestApp".
there is a test.xml file under "C:\$\TestApp\test.xml"
I made a virtural directory in IIS as "TestApp"

currently in application, "Request.MapPath( string)" is used to get the full
filepath.
the result is like @"c:\inetpub\wwwroot\TestApp\test.xml"
but the real path is @"c:$\TestApp\test.xml".

What should I use to get the real path?

Thanks
Jun 1 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Jun 1, 10:20 pm, "Ken" <k...@jeromegroup.comwrote:
I have application files under "C:\$\TestApp".
there is a test.xml file under "C:\$\TestApp\test.xml"
I made a virtural directory in IIS as "TestApp"

currently in application, "Request.MapPath( string)" is used to get the full
filepath.
the result is like @"c:\inetpub\wwwroot\TestApp\test.xml"
but the real path is @"c:$\TestApp\test.xml".

What should I use to get the real path?

Thanks
Request.MapPath("/TestApp/test.xml")

Jun 1 '07 #2

P: n/a
Ken
I currently used that way- Request.MapPath("/TestApp/test.xml").
that is why I got @"c:\inetpub\wwwroot\TestApp\test.xml"
however, that is not correct file path.
real filepath is "C:\$\TestApp\test.xml"
What should I use to get the real path?

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@w5g2000hsg.googlegrou ps.com...
On Jun 1, 10:20 pm, "Ken" <k...@jeromegroup.comwrote:
>I have application files under "C:\$\TestApp".
there is a test.xml file under "C:\$\TestApp\test.xml"
I made a virtural directory in IIS as "TestApp"

currently in application, "Request.MapPath( string)" is used to get the
full
filepath.
the result is like @"c:\inetpub\wwwroot\TestApp\test.xml"
but the real path is @"c:$\TestApp\test.xml".

What should I use to get the real path?

Thanks

Request.MapPath("/TestApp/test.xml")

Jun 1 '07 #3

P: n/a
On Jun 1, 11:18 pm, "Ken" <k...@jeromegroup.comwrote:
I currently used that way- Request.MapPath("/TestApp/test.xml").
that is why I got @"c:\inetpub\wwwroot\TestApp\test.xml"
however, that is not correct file path.
real filepath is "C:\$\TestApp\test.xml"
What should I use to get the real path?
Ken, actually, I think it should give the real path. Try to make
iisreset (Start - Run) and see what happens

Jun 1 '07 #4

P: n/a
Ken
No help.

Thanks through

Ken
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
On Jun 1, 11:18 pm, "Ken" <k...@jeromegroup.comwrote:
>I currently used that way- Request.MapPath("/TestApp/test.xml").
that is why I got @"c:\inetpub\wwwroot\TestApp\test.xml"
however, that is not correct file path.
real filepath is "C:\$\TestApp\test.xml"
What should I use to get the real path?

Ken, actually, I think it should give the real path. Try to make
iisreset (Start - Run) and see what happens

Jun 1 '07 #5

P: n/a
On Jun 2, 12:10 am, "Ken" <k...@jeromegroup.comwrote:
No help.

Thanks through

Ken
I tried to test the same config on my box and I've found that once the
virtual directory is changed and pointed to another directory, the
Request.MapPath() method is still getting an old path. After iisreset
it's starting to get the new path. This is a reason why I've told you
about iisreset utility.

Well... what else? Are you sure that the directory has been correctly
configured? Is the file accessible when you open it in a browser
http://localhost/TestApp/test.xml?

Jun 1 '07 #6

P: n/a
Ken
It was a naming issue.
after changing the websharing name, it works

Thanks

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
On Jun 2, 12:10 am, "Ken" <k...@jeromegroup.comwrote:
>No help.

Thanks through

Ken

I tried to test the same config on my box and I've found that once the
virtual directory is changed and pointed to another directory, the
Request.MapPath() method is still getting an old path. After iisreset
it's starting to get the new path. This is a reason why I've told you
about iisreset utility.

Well... what else? Are you sure that the directory has been correctly
configured? Is the file accessible when you open it in a browser
http://localhost/TestApp/test.xml?

Jun 4 '07 #7

P: n/a
On Jun 4, 5:04 pm, "Ken" <k...@jeromegroup.comwrote:
It was a naming issue.
after changing the websharing name, it works

Thanks

"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11**********************@g4g2000hsf.googlegro ups.com...
On Jun 2, 12:10 am, "Ken" <k...@jeromegroup.comwrote:
No help.
Thanks through
Ken
I tried to test the same config on my box and I've found that once the
virtual directory is changed and pointed to another directory, the
Request.MapPath() method is still getting an old path. After iisreset
it's starting to get the new path. This is a reason why I've told you
about iisreset utility.
Well... what else? Are you sure that the directory has been correctly
configured? Is the file accessible when you open it in a browser
http://localhost/TestApp/test.xml?- Hide quoted text -

- Show quoted text -
That's great that you got it working, Ken!

Jun 4 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.