DeleteFile doesn't work in Session_OnEnd???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Bates

    DeleteFile doesn't work in Session_OnEnd???

    I can successfully delete files using fso.DeleteFile when in an ASP
    script. But in Session_OnEnd, where I'd *really* like to clean up
    files, it appears that DeleteFile doesn't work. I've tried every
    combination I could think of. I've verified the filespecs I'm using by
    logging to a session log file.

    BTW, I found out the hard way that I can't reference
    Request.ServerV ariables("APPL_ PHYSICAL_PATH") from within
    Session_OnEnd. I had to copy that to Session("AppPat h") to keep it
    around for the OnEnd event. Without that, ASP just bails out of OnEnd,
    ignoring the remainder of the subroutine.

    I need to clean up temporary output files when a session ends.

    Any suggestions?

    TIA
    Tom
  • Bite My Bubbles

    #2
    Re: DeleteFile doesn't work in Session_OnEnd?? ?

    that;s the problem by design etc of session_onEnd.

    There are lots of articles on that but, in the end, it won;t work.

    "Tom Bates" <noneedto@email .me> wrote in message
    news:tjcllvcrbl 3ov5q83v96h056j kh2qngqjf@4ax.c om...[color=blue]
    > I can successfully delete files using fso.DeleteFile when in an ASP
    > script. But in Session_OnEnd, where I'd *really* like to clean up
    > files, it appears that DeleteFile doesn't work. I've tried every
    > combination I could think of. I've verified the filespecs I'm using by
    > logging to a session log file.
    >
    > BTW, I found out the hard way that I can't reference
    > Request.ServerV ariables("APPL_ PHYSICAL_PATH") from within
    > Session_OnEnd. I had to copy that to Session("AppPat h") to keep it
    > around for the OnEnd event. Without that, ASP just bails out of OnEnd,
    > ignoring the remainder of the subroutine.
    >
    > I need to clean up temporary output files when a session ends.
    >
    > Any suggestions?
    >
    > TIA
    > Tom[/color]


    Comment

    • Egbert Nierop \(MVP for IIS\)

      #3
      Re: DeleteFile doesn't work in Session_OnEnd?? ?

      "Tom Bates" <noneedto@email .me> wrote in message
      news:tjcllvcrbl 3ov5q83v96h056j kh2qngqjf@4ax.c om...[color=blue]
      > I can successfully delete files using fso.DeleteFile when in an ASP
      > script. But in Session_OnEnd, where I'd *really* like to clean up
      > files, it appears that DeleteFile doesn't work. I've tried every
      > combination I could think of. I've verified the filespecs I'm using by
      > logging to a session log file.[/color]

      This might be caused by security problems.

      Session_OnEnd runs under iwam_ and not under iusr_ or the user that logged
      in (if anonymous loggin is not used)

      --
      compatible web farm Session replacement for Asp and Asp.Net


      [color=blue]
      > BTW, I found out the hard way that I can't reference
      > Request.ServerV ariables("APPL_ PHYSICAL_PATH") from within[/color]
      ServerVariables are kept between browser and server. At Session_OnEnd there
      is no browser :)
      [color=blue]
      > Session_OnEnd. I had to copy that to Session("AppPat h") to keep it
      > around for the OnEnd event. Without that, ASP just bails out of OnEnd,
      > ignoring the remainder of the subroutine.
      >
      > I need to clean up temporary output files when a session ends.
      >
      > Any suggestions?
      >
      > TIA
      > Tom[/color]

      Comment

      • Tom Bates

        #4
        Re: DeleteFile doesn't work in Session_OnEnd?? ?

        WooHoo! That's It!

        I didn't realize that the Session_OnEnd ran under a different user ID.
        I added IWAM_<node> permissions and that took care of it.

        Thanks *very* much, Egbert, for the help. My hair can now start to
        grow back in. :-)

        Tom

        On Sun, 7 Sep 2003 08:51:21 +0200, "Egbert Nierop \(MVP for IIS\)"
        <egbert_nierop@ nospam.com> wrote:
        [color=blue]
        >"Tom Bates" <noneedto@email .me> wrote in message
        >news:tjcllvcrb l3ov5q83v96h056 jkh2qngqjf@4ax. com...[color=green]
        >> I can successfully delete files using fso.DeleteFile when in an ASP
        >> script. But in Session_OnEnd, where I'd *really* like to clean up
        >> files, it appears that DeleteFile doesn't work. I've tried every
        >> combination I could think of. I've verified the filespecs I'm using by
        >> logging to a session log file.[/color]
        >
        >This might be caused by security problems.
        >
        >Session_OnEn d runs under iwam_ and not under iusr_ or the user that logged
        >in (if anonymous loggin is not used)[/color]

        Comment

        Working...