delete file automatically after session ends
Posted: Mon Mar 01, 2010 9:08 am
hi guys,
i am new not only to this forum but to php too. I have allowed the user to upload file n each file name is session id. n i store the filename in $_SESSION variable but when the user signs out or closes their browser, i want php to delete that file which was uploaded.
presently my solution to this problem is:
i run jquery to refresh a div after every 1 mseconds n that div is refering to php file which checks if user has logged out then delete file else dont...
but my bad luck...this is not working...i thought might as well see the experts, can you guys please suggest whether i can do this or not in php.
many thanks in advance
i am new not only to this forum but to php too. I have allowed the user to upload file n each file name is session id. n i store the filename in $_SESSION variable but when the user signs out or closes their browser, i want php to delete that file which was uploaded.
presently my solution to this problem is:
i run jquery to refresh a div after every 1 mseconds n that div is refering to php file which checks if user has logged out then delete file else dont...
but my bad luck...this is not working...i thought might as well see the experts, can you guys please suggest whether i can do this or not in php.
many thanks in advance