Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Server side control of resource (html or image files) access
#2
In general, static files (like images and videos) are served without any session validation.

Having said that, there are several ways to accomplish that, but I would use a TContentHandler to deal with that.

I would register a content handler for a specific url/path (example LoginResource) and then I would request it like

$.get("/LoginResource", xxxxx);

The LoginResource content handler have full access to the session object and the request. It can just decide based on those, which file it will serve. It can also skip the "serving file" part and just redirect to a specific file in your wwwroot folder. In this case it your content handler would descend from TContentRedirect. The code is relatively short and straightforward.

Are you familiar with content handlers?
Reply


Messages In This Thread
RE: Server side control of resource (html or image files) access - by Alexandre Machado - 04-13-2022, 06:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)