Results 1 to 3 of 3

Thread: Opposite of Server.MapPath

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Given the physical path of a file, how would I get its virtual path from the web site?

    Thanks,
    Josh

  2. #2
    Guest
    You would have to know the physical path of the webroot to know for sure.

    The default for IIS is c:\inetpub\wwwroot, but it can be changed to any directory.

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Yeah, right now I'm stripping the "d:\inetpub\wwwroot" from the file name string and then replacing all "\"s with "/"s. I was hoping there was a more elegant, automatic way.

    Thanks,
    Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width