Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. What's the opposite of Server.Map?

What's the opposite of Server.Map?

Scheduled Pinned Locked Moved ASP.NET
questioncomsysadmin
3 Posts 3 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lnong
    wrote on last edited by
    #1

    Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?

    N V 2 Replies Last reply
    0
    • L lnong

      Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?

      N Offline
      N Offline
      Nickson
      wrote on last edited by
      #2

      You can create a virtual directory in your website through IIS. And then you can access your file using a URL. rgds, Nickson rgds, Nickson

      1 Reply Last reply
      0
      • L lnong

        Here's what I need to do: Lets let I have a file located at "Z:\MyApp\myFile.txt" on the server. On my web form, I have a Hyperlink that I want to direct to (and open) this file. How do I obtain the virtual address for this file so that I can create the hyperlink? For instance, I can't just do file because the client computer doesnt know where Z: is. I need a way to map "Z:\MyApp\myFile.txt" to something like "http://www.mysite.com/myFile.txt" so that the link will be recognized. I think I saw some function that does this but I cant remember what it's called. Server.Map maps a virtual address to a physical address. I need to do the opposite. Can someone show me some light here?

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        Hi Inong, In ASP.NET, you can try HttpRuntime.AppDomainAppPath would give you the physical path of the application and then you can build the path. HttpRuntime.AppDomainAppVirtualPath which would give the virtual path (IIS Virtual directory) Deepak Kumar Vasudevan http://deepak.portland.co.uk/

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups