Convert Physical path to Virtual path?

Discussion in 'ASP General' started by Scott Tilton, Jul 11, 2003.

  1. Scott Tilton

    Scott Tilton Guest

    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
    or
    www.avantekservices.com or www.avsv.com

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

    ** Support Cancer Research: http://www.rosepedal2003.com **
    Scott Tilton, Jul 11, 2003
    #1
    1. Advertising

  2. path = "q:\quotewerks\images\front emerald.jpg"
    path = replace(replace(path, "q:\quoteworks", ""), "\", "/")
    response.write path


    "Scott Tilton" <> wrote in message
    news:...
    > 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
    > or
    > www.avantekservices.com or www.avsv.com
    >
    > "A focused mind is the ultimate weapon." - Unknown
    >
    > ** Support Cancer Research: http://www.rosepedal2003.com **
    >
    >
    Aaron Bertrand - MVP, Jul 11, 2003
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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
    > or
    > www.avantekservices.com or www.avsv.com
    >
    > "A focused mind is the ultimate weapon." - Unknown
    >
    > ** Support Cancer Research: http://www.rosepedal2003.com **
    >
    >
    Dhananjay Modak, Jul 11, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krishna Sagiraju

    convert virtual address to physical address

    Krishna Sagiraju, Jul 10, 2004, in forum: C Programming
    Replies:
    3
    Views:
    1,193
    Malcolm
    Jul 10, 2004
  2. =?Utf-8?B?SmVmZiBCZWVt?=

    physical path to virtual path under virtual directory

    =?Utf-8?B?SmVmZiBCZWVt?=, Aug 1, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,013
    Eliyahu Goldin
    Aug 1, 2007
  3. marss
    Replies:
    5
    Views:
    988
    marss
    Sep 13, 2007
  4. Jeffrey Walton

    How To Convert Physical Path to URL?

    Jeffrey Walton, Dec 9, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    2,535
    Patrice
    Dec 9, 2009
  5. Guest

    Virtual Path and physical root

    Guest, Aug 2, 2004, in forum: ASP General
    Replies:
    4
    Views:
    205
    Guest
    Aug 2, 2004
Loading...

Share This Page