File path as MVC route argument

前端 未结 2 1559
一整个雨季
一整个雨季 2020-12-10 11:42

Part of my application maps resources stored in a number of locations onto web URLs like this:

http://servername/files/path/to/my/resource/

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 12:25

    A route like

    "Files/{*path}"
    

    will get the path as a single string. The * designates it as a wildcard mapping and it will consume the whole URL after "Files/".

提交回复
热议问题