Question
Delete server-side file upon browser close
Hello, everyone.
Is there a way to delete a server-side file if the browser is closed?I have a pop-up window that allows a user to send an email to someone that will have a file attachment. Currently, the file data is read from a VARBINARY(MAX) column in a database and created/saved in a folder that is created for it (with a unique name for the directory) when the pop-up first loads. When the form is submit, the file is emailed then deleted and the directory for it is removed.If the user changes his/her mind and closes the pop-up without hitting submit, the file and directory are left. I'd like to be able to delete the file and remove the directory if the pop-up is closed without hitting submit.Can this be done with JavaScript? Or can this only be done with ColdFusion?If only server-side scripting can do this, how can I trigger the script to run when the browser is closed?Thanks,^_^
