473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 19 '05 #1
3 3066
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.c om...
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

Jul 19 '05 #2
"Tom Bates" <no******@email .me> wrote in message
news:tj******** *************** *********@4ax.c om...
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.ServerV ariables("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("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


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_OnEn d 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
2195
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. The code is very simple and it should work, any idea why it doesn't? Sub Session_OnEnd If Session("User_ID")<>" " Then ' check if user has logged in before.
3
3705
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 ID=xxxxxx;Pwd=xxxxxxx" Set objConnEnd = Server.CreateObject("ADODB.Connection") objConnEnd.Open strConnect
24
2459
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 login again, i bounce them to an error page. i use the session_onEnd sub within global.asa to remove their userID from the array at the end of their session, and this seems to work fine. however, if i just shut down the browser, the sub_onEnd...
11
1836
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 (even though i've got infinite hosting space, i feel it somewhat impolite to leave GB's of useless temp files ;-) ). The Session_OnEnd event, though, seems to have some problems in doing this: 1. I found in MSDN that it couldn't call...
4
3716
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 only accessible by the shell object such as Temporary Internet Files, etc. Thanks!
1
5929
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(), but it make me confused. Is MS File Management Functions and ANSI stdio functions not compatible? the code is: #include <stdio.h> #include <windows.h> int main(int argc, char* argv)
0
8863
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9238
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2602
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.