dynamically deleteing subfolder causes ASPNET2.0 website to reset

  • Thread starter Thread starter msnnews.msn.com
  • Start date Start date
M

msnnews.msn.com

hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul
 
Hi,

msnnews.msn.com said:
hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul

Funny, I just blogged today about that. As far as I can say, there are
no solutions...

http://geekswithblogs.net/lbugnion/archive/2006/08/21/88603.aspx

One workaround I thought of is to delete the folders only when all
sessions are terminated... That would mean keeping track of all open
sessions in the Application object, and delete the folders when the last
Session_End is fired.

HTH,
Laurent
 
thanks for your replies..

i dont have any problems on creating the sub-directories, it only resets the
sessions when i delete the sub folders.
As for now, i have changed my code to empty the files in the folder, and add
a marker file (something like "~DELETED.txt") so i know that it has been
deleted.

thanks,
Paul
 
msnnews.msn.com said:
hi there,

i've got a photo gallery that programatically creates a subfolder for each
gallery, if i delete the album in my site, it also deletes the subfolder,
but resets my website and i lose the active sessions..

please help! whats the solution to this so it doesnt reset on delete?

thanks,
Paul
Keep the dirs outside the webroot?
 
we have been doing this in 1.1 & 2.0 and have not seen this behaviour i
think because we create/delete out temp directories in an existing directory
under the site root and not in the root itself.

ie :
siteroot/tmp/...create&delete temp folders here
siteroot/...not here
 
I take that back.
The reason it was never noticed was because we make no use of session data
( web service ) .
Adding a few breakpoints shows that this in fact is happening.
 
Hi,

Ray said:
Keep the dirs outside the webroot?

That's not always practical. In the case of a photoalbum, for example,
the directories with the pictures have to be under the root, because the
pictures are included using <img src="..." /> where "..." is relative to
the root.

HTH,
Laurent
 
I agree.
There should be a way to designate a directory under which subdirectory
creation/deletion has no impact on session or application start/stop. Maybe
an App_Tmp directory ( the way we do it ) or a web.config setting possibly
to disable this behaviour altogether.

To me this another wtf 'feature' right up there with web.config inheritance
 
Back
Top