ertank 27 Posted April 16, 2023 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
Andrea Magni 75 Posted April 24, 2023 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
ertank 27 Posted April 24, 2023 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. 1 Share this post Link to post