469,600 Members | 2,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Get the full file path

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
7 2827
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
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
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
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
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
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
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.

Similar topics

3 posts views Thread by Xah Lee | last post: by
15 posts views Thread by (Pete Cresswell) | last post: by
5 posts views Thread by Smarty | last post: by
11 posts views Thread by rh00667 | last post: by
4 posts views Thread by Michel Rouzic | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.