Aspnetcore: How to get IP? To concatenate it with the image url

Created on 16 Dec 2016  路  6Comments  路  Source: dotnet/aspnetcore

I have Image files in wwwroot folder, and I have stored their url without server ip in the database.

Now I want to send image links and I need to add server ip in front of the image address

All 6 comments

@khellang thats not what i want, it is physical path... I need the server ip or url so I can construct a correct url for images

TBH, I think you're much better off asking questions like this at StackOverflow...

@mister-giga Use a UrlHelper to construct a full url to the action.

I got banned at stack overflow :D
I did with UriHelper method

Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Request);
and it returns full requested URL.
Thanks for help

Was this page helpful?
0 / 5 - 0 ratings