Q:

How to get applicationPath from HttpContext.Request in dotnet core 3.0

I need to fetch data from HttpContext.Request in my custom middleware to provide public url for application assets. 
How can you get StoreName & FilePath from this path:
http://example.com/api/fileService/storage/{StoreName}/{path/to/file}
This case needs new route template? I'm student, sorry for newbie question.

A:

HttpContext.Request.PathBase will return the current local path of your application.
As you know how your path is build, you can extract the parameters from there. When trying to match your "path/to/file" parameter remember that slashes will be url encoded as "path%2Fto%2Ffile".

