473,405 Members | 2,160 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,405 software developers and data experts.

is there an opposite of server.mappath?

Given a URL to a file, you can user server.mappath to get the actual system
file path.

Is there a function that does the opposite?

Ie, if I have this:

c:\inetpub\wwwroot\documents\myfile.txt

is there a function that will return:

/documents/myfile.txt?

I could parse the above do that myself, but was wondering if there is
already a built in function for that.

-Darrel
Nov 19 '05 #1
5 4600
No there's not, because you could have any number of applications that map
onto that physical path.

You probabaly should always build a relative path from Request.ApplicationPath.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Given a URL to a file, you can user server.mappath to get the actual
system file path.

Is there a function that does the opposite?

Ie, if I have this:

c:\inetpub\wwwroot\documents\myfile.txt

is there a function that will return:

/documents/myfile.txt?

I could parse the above do that myself, but was wondering if there is
already a built in function for that.

-Darrel


Nov 19 '05 #2
(lru)htappam.reves

--
Good Monday Morning,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"darrel" <no*****@hotmail.com> wrote in message
news:uX**************@TK2MSFTNGP10.phx.gbl...
Given a URL to a file, you can user server.mappath to get the actual
system
file path.

Is there a function that does the opposite?

Ie, if I have this:

c:\inetpub\wwwroot\documents\myfile.txt

is there a function that will return:

/documents/myfile.txt?

I could parse the above do that myself, but was wondering if there is
already a built in function for that.

-Darrel

Nov 19 '05 #3
> (lru)htappam.reves

har har. ;o)

-Darrel
Nov 19 '05 #4
"darrel" <no*****@hotmail.com> wrote in message
news:ua**************@TK2MSFTNGP09.phx.gbl...
(lru)htappam.reves


har har. ;o)


If you're going to attempt to be funny, at least be accurate...
Nov 19 '05 #5
YOU try typing "reverse" in reverse in a Monday morning! ;-)

--

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:eL**************@TK2MSFTNGP15.phx.gbl...
"darrel" <no*****@hotmail.com> wrote in message
news:ua**************@TK2MSFTNGP09.phx.gbl...
(lru)htappam.reves


har har. ;o)


If you're going to attempt to be funny, at least be accurate...

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: John Rebbeck | last post by:
I've got the directory f:\Company\Product set as web shared so it's got a virtual directory in the default web site on my test server's IIS. If I try to use Server.MapPath in that site it returns a...
6
by: Dan Sikorsky | last post by:
How do you use server.mappath to update a access database on a completely different computer? One of my websites needs to update a database on a completely different website. Example: My ASP...
1
by: Craig | last post by:
In my code I have this line of code.... CrystalReportViewer1.ReportSource = Server.MapPath("CrystalReportSummary.rpt") I moved the file, CrystalReportSummary.rpt, and I get an error. The...
7
by: benoit | last post by:
Hi, if I write this code to retrieve a folder on the server Server.mappath("/DATA") I get this error message System.InvalidOperationException: Failed to map the path '/DATA' the virtual...
5
by: MichiMichi | last post by:
When using Server.MapPath on IIS 5 on my localhost everything works well. All of the following commands are executed without any error Response.Write(Server.MapPath("/app_test") & "<br>")...
4
by: vunet.us | last post by:
How to use server.mappath() parent folder correctly: Server.MapPath("../test.asp") Thank you for the hint.
3
by: rn5a | last post by:
Server.MapPath returns the physical file path that corresponds to the specified virtual path whereas Request.MapPath maps the specified virtual path to a physical path. Assuming that a file named...
6
by: withers | last post by:
If I run Server.MapPath("/") on my operational Internet server I get, correctly, the physical path to the directory my page is in (d:\.... \...\htdocs). If I run Server.MapPath("/") on my...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have one line code in my program, occasionaly I will receive the following error: "The Path parameter for the MapPath method did not correspond to a known path" ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.