Deleting A Temp File On Session End From Global.asa
I am trying to write a sub that will delete a spreadsheet file created by the web user. THis is the code I have inserted into the global.asa file, but it is not working.
sub Session_OnEnd
'delete the temporary excel spreadsheet
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(Server.mappath("temp/<%=session.sessionid%>.xls"))
Set objFSO = Nothing
end sub
I have made sure that the temp folder has permissions set for the IUSR_machinename account to be able to delete files. I am running IIS 5 on a windows 2000 server.
View Replies
ADVERTISEMENT
Can I put a session.timeout = "45" in the global.asa file? and if yes, under what section?
View Replies
View Related
I have initialized some session variables in Global.asa for our web
application. But these session variables are returning null values; it is was
working fine before; Recently we have rebuild our servers.
Please let me know if anyone of you have some idea?
View Replies
View Related
Can I implement session without global.asa file in my root directory....and is there any good site for sessions tutorial.
View Replies
View Related
i want to increase my session time so that it does not expire till the user closes the site.
i have written in global.asa file the following code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Session_OnStart
Session.Timeout = -1
End Sub
</script>
but it doesnt work and my sesion still expires.
View Replies
View Related
Can I do the following things in the global.asa file?
When sessions starts:
Add a record into my database
When session ends:
delete it where rs("sessionid") = Session.SessionID...
?
I'm pretty sure I can, but...I've heard not ALL things can be done in global.asa...
Do I create an object, and a connection? How would I do it? Since I want a database in MY database, not in memory like I've seen...
View Replies
View Related
I am trying to setup an ASP code to write a text file to the client side, not the server side, for the purpose where it will be email attachment.
The following code seems to only work on the server side and was wondering if there as an equivalent out there for the client side since I am trying to avoid potential interruptions on the server side:
Const TemporaryFolder = 2
Dim myFSO, WriteStuff, myAttachment, tfolder
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set tfolder = myFSO.GetSpecialFolder(TemporaryFolder)
if (right(tfolder,1) <> "") then
tfolder = tfolder & ""
end if
myAttachment = tfolder & "test.txt"
Set WriteStuff = myFSO.CreateTextFile(myAttachment, True)
View Replies
View Related
I'm just dipping my toes into server-side scripting.
The Global.asa file seemed really nice, but am I understanding correctly that the application onstart event is fired ONLY when the server is started/re-started or when the FIRST user logs onto an ASP application?
If that's the case, then all the changes I keep making to my Global.asa file are pretty useless, right? (which seems to be the case -- i.e., my pages are not using any of the new information). Code:
View Replies
View Related
I recently installed IIS lockdown, and ever since my ASP pages have been hell. One problem is that now after a user views my ASP page which reads my local Access DB, the temporary file, .ldb, stays in the folder forever!
This temp file is created when a user opens the file, so I checked out the .ldb file and it says the ADMINISTRATOR is opening the file! How can the internet user be using the ADMIN account?! This is not good news! I will share my code for my page; however I have a feeling the code isn't the problem, but a setting is. Code:
View Replies
View Related
I am using the File System Object to create server side cookies and part of
the Function that I am writing deletes a file but I am getting a permissions
denied error on that line of code.
I am using Integrated security only on this site but how do I get the
IUSER_Machinename account to work with Integrated Security?
View Replies
View Related
On my webpage users can upload files and also delete those files. Everything seems to work, but when they upload a file that contains spaces, I am having problems getting the file deleted, for example: "This is my file.txt"
Is there a way I can delete this file. I have tried to take out the spaces, but the file still doesn't delete:
<%=Replace(Request("MyFile")," ","+")%>
View Replies
View Related
I have a little app running in ASP which lists a bunch of files that are in a directory. This is attained using the following code:
View Replies
View Related
I have this script in my global.asa file: Code:
set objFSO=server.createobject("scripting.FileSystemObject")
strPath = "C:SPharm3Verif.asp"
set objFile = objFSO.DeleteFile(strPath,true)
and it returns this error:
Run-Time Error Microsoft VBScript error '800a01a8'
Object required: 'objFSO.DeleteFile(...)'
//global.asa, line 29
line 29 happens to be the objFSO.DeleteFile(strPath,true)
View Replies
View Related
Is it possible to use ASP to delete a file on the web server?
I have a form that allows users to submit files to my site, but I now want
them to be able to delete their files too if possible.
I know the location and filename of the files (this is taken from a
recordset).
I am not 100% adept in ASP (I am using Dreamweaver to make my site) so an
example would be good please.
View Replies
View Related
where do you have to place your global.asa file in order for your session variables to work? If i dont have access to the root (not my server, a remote one), is there any way i can specify a path to my global.asa?
View Replies
View Related
I have a xml file with this structure: Code:
<online>
<user id="1">Alethesnake</user>
<user id="4">Goofy</user>
<user id="7">Donald duck</user>
</online>
Could you suggest me the best way to delete a node knowing its id (i.e. id=4)?
View Replies
View Related
How do I got about deleting a file with the TextStream Object?
View Replies
View Related
I can easily upload images, add to db etc etc... but is there a way of actually dynamically removing image files from the server? At the moment I have clients uploading banner adverts to the server, but if they decide to delete the image, it removes the record from the database.
I need to go one step further and remove these 'old files' from the server instead of simply taking up space etc. anyone have any great applications or scripts I can use with a delete statement?
View Replies
View Related
I'm trying to add a "user-verifacation" thingy to my site.
my problem is using/accessing session variables.
all the tutorials say that the global.asa should only have
the script tags (<script...> & </script>) and inside the script itself
only have the application/session onstart/end.
I've created this global.asa file and put it in my site-root folder:
<script type="text/javascript" language="javascript" runat=server>
function Session_OnStart()
{ Session("LoggedIn") = "NO"
}
</script>
but i can't access the session variable Session("LoggedIn")... from any page.
View Replies
View Related
I have started session("visitorID") in global.asa in order
to keep track of how many users are on our site at any
given time, trouble is I can't seem to call the session
while on another page.
As I am relatively new to asp I'll post both the setting
of the session and the call to it on the other page below Code:
View Replies
View Related
i have a logon page, i create session variables for every person who logs on, but when their session times out, i want to redirect them (or have a popup window) that tells them that they have been logged off, but i have no success.' global.asa:
<script language="vbscript" runat="server">
Sub Session_OnEnd
Response.Redirect "loggedout.asp"
End Sub
</script>
but it doesnt work, i set the timeout to 1 minute, and i lose the session variables, but i cant seem to redirect them to the loggedout page!
View Replies
View Related
I have a application which is a global login for other applications. Basically application A checks all the user login information and then lists all the applications B-Z that the user has access to.
I have a global.asa file in application A and individual global.asa files in applications B-Z. Applications B-Z are under the Application A directory. Can I have global.asa files in each of the application folders? Does the pages look for the closest global.asa file?
I have to keep track of user login time and logout tme for each application. The problem I run into is how do I record the user logout time when the session expires?
View Replies
View Related
CAn I set a session variable dynamically based on a value in a database and use the global.asa to do it...
View Replies
View Related
All, Just to give a little background this is reagarding an ASP 3.0
application running on IIS6 using the default app pool.
I have set the session timeout to 540 minutes in IIS (under options tab in
Application configuration). There is no code in the Session_OnStart or
Session_OnEnd in the global.asa. Via an include file, each page executes
these no-cache related code:
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.CacheControl = "private"
Sorry, just wanted to give some background on what we're dealing with.
Anyways, the problem is that the users are saying their session state is
expiring much sooner than 540 minutes. How is this possible? What did I miss?
Are there better techniques to ensure the 540 minute session?
View Replies
View Related
I have a tbl.pictures on my website, several of the columns have refferal links to images. Having read through another link on this site, apparently it's the best way to do it. (Keeping the images in file rather than on/in the database)
My problem is that when a photographer deletes a photograph from my database the image files remain on my server. For the moment its ok but long term when they delete the record I would also like the images to removed from my server.
Any ideas where I could start to look to do this?
View Replies
View Related
It worked fine with access db's but now it's giving me this error...
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.0.17-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM releases WHERE title = 'Cabela's Big Game Hunter 2005 Ad
/releaseerase.asp, line 16 Code:
View Replies
View Related
i just started learning what it can do, and I am using it to tracj how many people have logged into my site, but when people login to my site, I start 2 sessions, one for their ID, and one for their name. Is there any way to only count the name session as a session_onstart in global.asa?
View Replies
View Related
I'm using the following code in my global.asa file to set the
session.timeout value amongst other things -
Sub Session_OnStart
Session.Timeout = 40
Session("Authenticated") = 1
End Sub
Yet when I print out the value of session.timeout on a page after this
event has fired it returns 20 (I get the right value for
Session("Authenticated") so my code appears to be working).
I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn't provide much information on this
property.
View Replies
View Related
I need to set a session time out for this website that was created by someone else using ePower. How can I configure the global.asa page to set a time out session for the users or do I have to set this in IIS? Code:
View Replies
View Related
I have absolutely no idea how global.asa works. I've read through quite a number of articles and they're all fine and dandy but implementing it on my (first) ASP application just doesn't work. It's amazing how ASP.NET automates everything for you.
Anyway, I need to store session variables and I have no idea how to. I have no global.asa file, but I can declare session variables fine. So does that mean that somewhere in the ASP process, a Session_OnStart() method's already running.
If I create a global.asa file, I put it in the same directory with other ASP files right?
A global.asa file should contain the basic four application/session methods... and shouldn't really contain much code, unless I want to start a variable with a default value. True or false (I say true). Code:
View Replies
View Related
I am trying to run a Session_OnStart Script based on a Session variable that is created on a .asp page. The problem is that when I reference the Session in Global.asa It has no value but it has a value on the .asp page level. Is there a certain way that I have to reference a Session in Global.asa?
What I have is somthing like the following:
Sub Session_OnStart
If Session("NIS")<> "" Then
Run The Routine
End If
End Sub
Based on the above the routine does not run because Global.asa does not seem to get the value of Session("NIS").
View Replies
View Related
I have a text file being create with the FileSystemObject. It's being
built based on results from a SQL query. All this is working fine, but
so that I have a carriage return VBCRLF at the end of each row, I have
an empty row at the end of my text file. How do I delete this last line?
Code:
View Replies
View Related
Until now I've only seen VBScript to handle application and session events (e.g.
Application_OnStart, Session_OnStart). Is it possible to do this directly in
JavaScript or do I have to write VBScript proxies?
View Replies
View Related