473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.ServerVariables("APPL_PHYSICAL_PATH") from within
Session_OnEnd. I had to copy that to Session("AppPath") 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
Jul 19 '05 #1
3 3041
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" <no******@email.me> wrote in message
news:tj********************************@4ax.com...
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.ServerVariables("APPL_PHYSICAL_PATH") from within
Session_OnEnd. I had to copy that to Session("AppPath") 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

Jul 19 '05 #2
"Tom Bates" <no******@email.me> wrote in message
news:tj********************************@4ax.com...
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.
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
http://www.nieropwebconsult.nl/asp_session_manager.htm

BTW, I found out the hard way that I can't reference
Request.ServerVariables("APPL_PHYSICAL_PATH") from within ServerVariables are kept between browser and server. At Session_OnEnd there
is no browser :)
Session_OnEnd. I had to copy that to Session("AppPath") 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


Jul 19 '05 #3
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\)"
<eg***********@nospam.com> wrote:
"Tom Bates" <no******@email.me> wrote in message
news:tj********************************@4ax.com.. .
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.


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)


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Julian | last post by:
Hi I have code in my login.asp which sets the online field in user database to true or 1. I am trying to use the same code in global.asa to change back the online field to 0 but it doesn't work....
3
by: cab | last post by:
i have the following code in the "Sub Session_OnEnd" routine that does not seem to run..... Sub Session_OnEnd strConnect = "Driver={SQL Server};Server=SERVER;Database=database; User...
24
by: Nancy Drew | last post by:
hi all i'm trying to keep users from being able to login to a site twice at the same time. everytime a user does a login, i stick their userID into an application scoped array. if they try to...
11
by: andrea azzini | last post by:
I've got an ASP3 (IIS6) site, in which some scripts need to generate temporary files in order to work. Now, the fact is: I would like those temporary files to be deleted when a user's session ends...
4
by: rbt | last post by:
Can someone detail the differences between these two? On Windows which is preferred? Also, is it true that win32api.DeleteFile() can remove the 'special' files located in the 'special' folders...
1
by: Liucy | last post by:
Dear all, I encounter a problem about DeleteFile() with ANSI stdio functions. It always fails to delete file and sets ERROR_SHARING_VIOLATION. I know I can use remove() instead of DeleteFile(),...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.