#1 2016-12-29 22:44:25

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

MVC Enhancement Request

Hi AB the MVC Views can render .static data and views.

I have the Problem that we have to display thousands of dynamic Pictures in our View.
The Images are stored in the database.
Now i like to dynamically display images on my Client Site.

My Idea is to enhance the MVC View Renderer (InternalRunOnRestServer) with a kind of dynamic contents rendering.
For Example if URL start with .dynamic (like your .static) followed by some Text .dynamic/Pic1 then this Pic1 should be passed to a MVC function which can Return my Image Data.

The Other way would be to store the requested Images in .static/tmp subfolder but than i would have to care about garbage collection.

As other Option i have to check if the Client has the right to view the picture before sending it.

What do you think ?


Rad Studio 12.1 Santorini

Offline

#2 2016-12-30 04:33:33

Chaa
Member
Registered: 2011-03-26
Posts: 245

Re: MVC Enhancement Request

You can use TSQLRestServer.ServiceMethodRegister and get full control on processing request and response.
For example, all requests to /root/images/... will be passed to ImagesPage method:

procedure TMyApp.Start(aRestModel: TSQLRest);
begin
    ...
    TSQLRestServer(aRestModel).ServiceMethodRegister('images', ImagesPage, True);
end;

Offline

#3 2016-12-30 22:35:35

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: MVC Enhancement Request

ty i'll try


Rad Studio 12.1 Santorini

Offline

#4 2016-12-31 15:51:40

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: MVC Enhancement Request

tyvm it works perfekt now...


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB