473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2954
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Xah Lee | last post by:
Split File Fullpath Into Parts Xah Lee, 20051016 Often, we are given a file fullpath and we need to split it into the directory name and file name. The file name is often split into a core...
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
3
by: Wayne Aprato | last post by:
I am using code kindly provided by the Access Web to capture a file path and insert it into a form. The relevant part of the code follows: Function GetOpenFile(Optional varDirectory As Variant,...
2
by: Sridhar | last post by:
Hi, I have a web form where it has a <input type=file id=file1> control. I have an Upload button to upload the file. WHen I click on browse and select one file, it is showing the full file path...
3
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried...
4
by: Dots | last post by:
I have a class library with a method called getpath(). I want to be able to get the full path of a folder and write some files to the (my_files_dir) folder. A console application will use this...
5
by: Smarty | last post by:
Dear Friends, I did a file type validation in Javascript. Just i want to check whether a selected file is BMP or JPG. I wrote the following function for it. function checkType(){ Text =...
11
by: rh00667 | last post by:
hi all, i'm confused now. how i can get the full path of an application? if myapp is in a directory which belongs to PATH, argv gives me the first token of cmd line, and not the real path of...
4
by: Michel Rouzic | last post by:
I made a program that accepts as parameters an input file name that we'll call file1, and an output file name that we'll call file2, and opens on its own a configuration file called file3. My...
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.