473,748 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Physical path to Virtual path?

We have a field that gets filled into a database that our ASP website pulls
from. What we would like to be able to do is to take that path and convert
it to a virtual path so the website can display the image. We have setup
with our website a virtual directory for: "g:\quotewerks\ images\" which is
http://www.ourwebsite/images.

So, below you can see the data we pull from the field in the database, and
what I need it to look like. Can anyone help me out with the code to do
this?

From database:

q:\quotewerks\i mages\contact systems\contac3 s.jpg
q:\quotewerks\i mages\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\i mages\front emerald.jpg

Needs to be changed to:

/images/contact systems/contac3s.jpg
/images/fuji/cp6-5 cal/mvc-012f(2).jpg
/images/front emerald.jpg
Any help would be great, thanks!

Best Regards,

Scott B. Tilton

Avantek Services
Phone: (603)742-1333 Ext. 26
Fax: (603)299-0323
st*****@avantek services.com or st*****@avsv.co m
www.avantekservices.com or www.avsv.com

"A focused mind is the ultimate weapon." - Unknown

** Support Cancer Research: http://www.rosepedal2003.com **
Jul 19 '05 #1
2 20586
path = "q:\quotewerks\ images\front emerald.jpg"
path = replace(replace (path, "q:\quoteworks" , ""), "\", "/")
response.write path
"Scott Tilton" <st*****@avante kservices.com> wrote in message
news:Og******** ******@TK2MSFTN GP10.phx.gbl...
We have a field that gets filled into a database that our ASP website pulls from. What we would like to be able to do is to take that path and convert it to a virtual path so the website can display the image. We have setup
with our website a virtual directory for: "g:\quotewerks\ images\" which is http://www.ourwebsite/images.

So, below you can see the data we pull from the field in the database, and
what I need it to look like. Can anyone help me out with the code to do
this?

From database:

q:\quotewerks\i mages\contact systems\contac3 s.jpg
q:\quotewerks\i mages\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\i mages\front emerald.jpg

Needs to be changed to:

/images/contact systems/contac3s.jpg
/images/fuji/cp6-5 cal/mvc-012f(2).jpg
/images/front emerald.jpg
Any help would be great, thanks!

Best Regards,

Scott B. Tilton

Avantek Services
Phone: (603)742-1333 Ext. 26
Fax: (603)299-0323
st*****@avantek services.com or st*****@avsv.co m
www.avantekservices.com or www.avsv.com

"A focused mind is the ultimate weapon." - Unknown

** Support Cancer Research: http://www.rosepedal2003.com **

Jul 19 '05 #2
One way is:
- read physical path
- use combination of mid and instr functions to find the 2nd slash
- cut the string at the 2nd slash (assumption: first directory is the root
of the web site)

cheers
Dhananjay

"Scott Tilton" <st*****@avante kservices.com> wrote in message
news:Og******** ******@TK2MSFTN GP10.phx.gbl...
We have a field that gets filled into a database that our ASP website pulls from. What we would like to be able to do is to take that path and convert it to a virtual path so the website can display the image. We have setup
with our website a virtual directory for: "g:\quotewerks\ images\" which is http://www.ourwebsite/images.

So, below you can see the data we pull from the field in the database, and
what I need it to look like. Can anyone help me out with the code to do
this?

From database:

q:\quotewerks\i mages\contact systems\contac3 s.jpg
q:\quotewerks\i mages\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\i mages\front emerald.jpg

Needs to be changed to:

/images/contact systems/contac3s.jpg
/images/fuji/cp6-5 cal/mvc-012f(2).jpg
/images/front emerald.jpg
Any help would be great, thanks!

Best Regards,

Scott B. Tilton

Avantek Services
Phone: (603)742-1333 Ext. 26
Fax: (603)299-0323
st*****@avantek services.com or st*****@avsv.co m
www.avantekservices.com or www.avsv.com

"A focused mind is the ultimate weapon." - Unknown

** Support Cancer Research: http://www.rosepedal2003.com **

Jul 19 '05 #3

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

Similar topics

0
1979
by: jason | last post by:
What is the best way to handle global includes for 3 subwebs that may at various times consume similiar include files such as ENQUIRY FORMS. I ask this question as I now have the oppportunity to control sub webs more tightly on my new host via virtual director and wish to improve the folder structure and code on my various sites. However, I am concerned with the implications for the PHYSICAL and RELATIVE file path options.
2
3110
by: Simon | last post by:
I wonder if someone can help with this - I 'm creating an IISVirtualDirectory, and setting its Path property to the physical path I want to reference. This works fine when I have a standard file path - 'C:/Test' - however I sometimes have a UNC path - '//remoteComputer/Test' - and IIS appears to choke when it's given that. So, is there any way of translating a UNC path to the physical path on the remote computer? ie: Translating '...
0
1480
by: jimmy | last post by:
Hoping someone can help. I've setup several FTP shares on IIS 5, where some of the shares are located on another computer, while other directories are on the local computer. Is there a function similar to server.mappath that I can use to return the physical path of a FTP virtual directory using ASP? For example, I have a virtual directory called TestA located at
3
9581
by: Krishna Sagiraju | last post by:
hai, can we convert virtual address to physical address using c/c++ ? thanx Krishna
1
1990
by: Michiel Schaeverbeke | last post by:
Hi, I'm trying to reach an xml file from within a web application. The file is physically on a different server. When I try to reach it using \\servername\path\ style, I get the error "\\servername\path\ is a physical path". Using a virtual directory gives the same result. All I really do is the following: // XmlTransformer is a System.Web.UI.WebControls.Xml object
2
2689
by: Yoshitha | last post by:
Hi I am developing an application in which am using the windows application template. In one of the form i'll place a text box control and a button control, if i entered the virtual directory name in this text box then it has to show me the output the physical path of the virtual directory i've given. For eg. if the virtual directory name is "sample" if i enter "sample" in text box then it has to show the path where it is mapped to...
2
6202
by: dmalhotr2001 | last post by:
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
5
31048
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 to the same web application)? Usually I do in this way: virtualFilePath = physicalFilePath.Replace(physicalRootDirectoryPath,"~/") Perhaps, is there standard inbuilt method?
2
2568
by: Jex | last post by:
Hi, I hv create an application using C#, Asp.Net (VS 2005) and I add an Installer Class to that application's setup (when deploy that app), so that I can change the version to 2.0, Now, I need to store all the details about the virtual dir, (where the application is going to be stay in client sys) I need the physical path or virtual dir, and name (using the Installer Class and the retrived values to be stored in text file, coz i need the...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.