Jump to content


Photo

Unlink a file after Reading it


  • Please log in to reply
2 replies to this topic

#1 ibanez270dx

ibanez270dx
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 11 August 2006 - 11:19 PM

Hi,
I have a script that dynamically creates an .XLS, saves it on the server, and then opens it ... but I want to delete it after the user exits the .XLS. I used the unlink($myfile) command on the line after I used meta tags to open the .XLS automatically, but it deleted before it even opened. If I can just dynamically create the excel and open it without saving to my server first, that would be even better. Anybody know something that can help me out?

Any help is appreciated,
- Jeff

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 12 August 2006 - 12:22 AM

You can do this using Javascript.
PHP Ninja

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 August 2006 - 12:42 AM

You can do this using Javascript.


You can't delete (unlink) a file on the server with javascript.  At best, and maybe what you are thinking, you can use AJAX to notify the server that a browser window has been closed, but if the file is being viewed in Excel, then JS can't tell when Excel is closed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users