Hi !
I'm downloading a file via ftp to my server. The file should be
destroyed IN ALL CASES when then script ends - but it isn't.
Have a look at the following code-snippet. I register "OnShutdown" as a
Shutdown-Function, but the filename isn't unlinked when the script
terminates. Calling OnShutdown directly deletes the file (just as a
"debug-test").
Any ideas, why OnShutdown isn't called when the script terminates ?
Martin
<?php
register_shutdown_function("OnShutdown");
$tmp_filename = ""; // Temp Filename on server
function OnShutdown()
{ global $tmp_filename;
if ($tmp_filename != "")
{ unlink($tmp_filename);
$tmp_filename = "";
}
}
class Download
{... class to download file
};
?>