HOME       >>       Programming

How To Delete Files When Session Ends


vicky99

Dear FriendsI need solution to a problem. The problem is as under:I am creating certain files (playlist) in server disk when user selects some songs. The files are created in ram format. What I want to do is to delete these files created during a particular session. Is it possible to do so? Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP.


TavoxPeru

I think it is possible to delete the files before the session is ended by using the unlink() php function, but you need the correct system priviligies to do it.Best regards,


Hercco

Or use a system call?


TavoxPeru

Or use a system call?

Yes you are right, it is another solution but many host servers for security reasons disable this functions so you can't use it.

Best regards,

humphrey88

Dear FriendsI need solution to a problem. The problem is as under:
I am creating certain files (playlist) in server disk when user selects some songs. The files are created in ram format. What I want to do is to delete these files created during a particular session. Is it possible to do so? Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP.


Hi

I have just learnt how to do it. I think you can use the session_destroy() function. More information can be found at http://sg.php.net/session_destroy

I hope that the website would give you the answer that you are searching for.

Cheers.


VIEW ORIGINAL REGISTER GET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.