Project

General

Profile

ALHow to check if WFileResource is not used anymore?

Added by A L over 6 years ago

Hi,

I have a WFileResource that is created on demand,
and downloaded with

wApp->redirect(fileResourcePtr->url());

Now I would like to delete it, when no longer needed.
But after reading twice the documentation
of WResource hierarchy, I have no idea how to
check if e.g. WFileResource has been already downloaded
by the client. Is there a way to do this?

Thanks and best wishes,
Adrian


Replies (2)

RS RE: How to check if WFileResource is not used anymore? - Added by Roel Standaert over 6 years ago

That's indeed not something WResource keeps track of by default. You could hook into handleRequest() to see if that's been called. Note: don't try to delete the resource in handleRequest(). You'll have to defer the deletion.

AL RE: How to check if WFileResource is not used anymore? - Added by A L over 6 years ago

OK, thanks --- I'll try to this.
BTW, Wt is great.

Best wishes,
Adrian

    (1-2/2)