ibanez270dx Posted August 11, 2006 Share Posted August 11, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/17298-unlink-a-file-after-reading-it/ Share on other sites More sharing options...
Caesar Posted August 12, 2006 Share Posted August 12, 2006 You can do this using Javascript. Quote Link to comment https://forums.phpfreaks.com/topic/17298-unlink-a-file-after-reading-it/#findComment-73454 Share on other sites More sharing options...
hitman6003 Posted August 12, 2006 Share Posted August 12, 2006 [quote]You can do this using Javascript.[/quote]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. Quote Link to comment https://forums.phpfreaks.com/topic/17298-unlink-a-file-after-reading-it/#findComment-73466 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.