ASP.NET Get physical filepath from URL

前端 未结 3 2038
囚心锁ツ
囚心锁ツ 2021-01-18 02:09

Is there a way to get the physical filepath from an ASP.NET\'s URL?

Scenerio: I have an app that is on two severs, but it will now be on lots more, and each server p

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 02:41

    You can use HttpServerUtility.MapPath on the server side in order to get the physical path of a file, then return it in the Application or Session object, similarly to what you are doing now.

    As for the physical path of a URL - there might not be one, as URLs can be re-written.

提交回复
热议问题