I think there is no direct way in PHP. This can be done using Global.aspx file in asp.net.
For PHP work around, we can keep the list of created sessiond and then checking for the each sessions if they are available. If any session is found destroyed, we can delete the uploaded files by that session. However, this adds additional efforts managing the session tables along with the list of uploaded files per session.