Jump to content
ertank

How to automatically delete temporary files using MARS

Recommended Posts

Hello,

 

MARS file serve samples are based on fixed static data (ContentTypes demo). I have several endpoints serving dynamic data in ZIP files. When upload finishes on the server side, remaining temporary files are kept on disk. This become a problem on server systems in time.

 

I would like to learn if it is possible to have MARS delete them automatically at the end of the communication.

 

I will write my own thread but asking before just in case.

 

Thanks & Regards,

Ertan

Share this post


Link to post

Hello Ertan,

you may want to check the AfterInvoke capabilities:

 - you can define a local method in your resource class that will be called after the request has been executed, yet before connection is closed; that seems a good place to cleanup temporary files

 - there is also a global mechanism ( look for  TMARSActivation.RegisterAfterInvoke in Server.Ignition.pas in the MARSTemplate Demos folder).

 

Hope this helps, let me know if you need something more.

 

Sincerely,

Andrea

Share this post


Link to post

Hello Andrea,

 

I did already coded a thread for that purpose which seems to work fine for the time being.

I will also check AfterInvoke.

 

Thanks.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×