S
Sky Sigal
I have created an IHttpHandler that waits for uploads as attachments for a
webmail interface, and saves it to a directory that is defined in
config.xml.
My question is the following:
assuming that this is suppossed to end up as a component for others to use,
and therefore I do NOT have access to their global.cs::Session_End()
how do I cleanup files that were uploaded -- but obviously left stranded
when the users aborted/gave up writting email?
My thoughts were:
* look for files in the directory that have a create date that is Now() - 20
minutes or so.
* but how do I launch it? MyUploader.Dispose == too early. Maybe I could
launch a sleep/timer -- but which user/thread launches it? -- if every user
is launching one, this could turn into a total fiasco, with each user
launching secondary threads...
* I could look for these 'old files' every time a new user uploads -- and
clean up then I guess. Meaning there would always be files there, never
empty. Doesn't feel right...but doable...
* I am worried about this timer business because -- some writers are
SLOW...They might finish email after 20 minutes... any ideas?
I looked into the fact that Session_Start() is a method of
IHttpApplication -- but I don't think I could wire into that as easily as
IHttpHandler, or IHttpModule.
Any suggestions?
Thank you very much,
Sky
webmail interface, and saves it to a directory that is defined in
config.xml.
My question is the following:
assuming that this is suppossed to end up as a component for others to use,
and therefore I do NOT have access to their global.cs::Session_End()
how do I cleanup files that were uploaded -- but obviously left stranded
when the users aborted/gave up writting email?
My thoughts were:
* look for files in the directory that have a create date that is Now() - 20
minutes or so.
* but how do I launch it? MyUploader.Dispose == too early. Maybe I could
launch a sleep/timer -- but which user/thread launches it? -- if every user
is launching one, this could turn into a total fiasco, with each user
launching secondary threads...
* I could look for these 'old files' every time a new user uploads -- and
clean up then I guess. Meaning there would always be files there, never
empty. Doesn't feel right...but doable...
* I am worried about this timer business because -- some writers are
SLOW...They might finish email after 20 minutes... any ideas?
I looked into the fact that Session_Start() is a method of
IHttpApplication -- but I don't think I could wire into that as easily as
IHttpHandler, or IHttpModule.
Any suggestions?
Thank you very much,
Sky