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

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\images\contact systems\contac3s.jpg
q:\quotewerks\images\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\images\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*****@avantekservices.com or st*****@avsv.com
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 20557
path = "q:\quotewerks\images\front emerald.jpg"
path = replace(replace(path, "q:\quoteworks", ""), "\", "/")
response.write path
"Scott Tilton" <st*****@avantekservices.com> wrote in message
news:Og**************@TK2MSFTNGP10.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\images\contact systems\contac3s.jpg
q:\quotewerks\images\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\images\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*****@avantekservices.com or st*****@avsv.com
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*****@avantekservices.com> wrote in message
news:Og**************@TK2MSFTNGP10.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\images\contact systems\contac3s.jpg
q:\quotewerks\images\fuji\cp6-5 cal\mvc-012f(2).jpg
q:\quotewerks\images\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*****@avantekservices.com or st*****@avsv.com
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
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...
2
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...
0
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...
3
by: Krishna Sagiraju | last post by:
hai, can we convert virtual address to physical address using c/c++ ? thanx Krishna
1
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...
2
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...
2
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...
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...
2
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...
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
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.