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

virtual path from a physical one

Hi,

I was wondering is there a way to get the virtual path (i.e.
http://localhost/blah/blah) if you specify a physical one (i.e.
C:\wwwroot\inetput\exampleDir).

I know you can do the opposite with Server.MapPath. However I'm
looking for going from physical to virtual path.

Thanks

:D

Dec 3 '05 #1
2 6175
I think you may be looking for Request.PhysicalApplicationPath. Scott Cate
put up a nice summary table of all this here:

http://weblogs.asp.net/scottcate/arc...15/257736.aspx

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"dm**********@yahoo.com" wrote:
Hi,

I was wondering is there a way to get the virtual path (i.e.
http://localhost/blah/blah) if you specify a physical one (i.e.
C:\wwwroot\inetput\exampleDir).

I know you can do the opposite with Server.MapPath. However I'm
looking for going from physical to virtual path.

Thanks

:D

Dec 3 '05 #2
Actually no,

What I want is when I pass in to a function (i..e
C:\wwwroot\inetpub\test\test\test), it will convert it to a virtual
root like http://localhost/test/test/test.

Is there something that does that?

Thanks

:D

Dec 4 '05 #3

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

Similar topics

8
by: And | last post by:
Hi everyone my database is in a folder inside the inetpub folder (c:\inetpub\bd\mydatabase.mdb) and my web application is in a folder inside the wwwroot folder. My question is: Is there a way...
4
by: david | last post by:
I basically use the following code to display the directory and file names in the WWWROOT, but can not show the virtual directory. ---- Dim path As String = Server.MapPath(x) Dim di As...
6
by: Saar Carmi | last post by:
Hi How can I get the application's virtual directory from the Application_Start method in Global.asax ? Keep in mind there is no request/response object available yet in this stage. Thanks...
16
by: B Letts | last post by:
Hi - I'm currently using the FileUpload control to allow people to upload files to my website. This all works fine, as long as I'm going to a physical path on my server. However, I need to...
14
by: Lorenzo | last post by:
Hello, I have a web application with a virtual directory in it. With 'virtual directory' i mean a folder whose physical path is different from the physical path of the application, but in which...
2
by: Lucky | last post by:
Hi guys, Again asking Question regarding Virtual Directories. now i've got the Virtual Directories list with the help of Michael. the code is used to get the virtual directory is ...
4
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
Best way I can think to describe this is through an example. I have a virtual directory, let's call it "MyVirtualDirectory" that maps to \\MyServer\Shared. I have a path that is...
6
by: ManagedCoder | last post by:
Hi, My requirement is as follows: I need to set the HttpExpires (enable content expiration - set to 7 days) on a folder within a virtual directory. I have been able to set the HttpExpires...
5
by: marss | last post by:
Server.MapPath("~/page.aspx") returns the physical file path based on the specified virtual path. Is there any reverse method to get the virtual path based on the physical path (both pathes belong...
5
by: Ned White | last post by:
I have set up a virtual directory on ISS 6.0 to store the all .jpg and .swf files which i use in my project It is alias name is "OutSrc" Is it possible to acquire a list of files which exist in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.