delete tmp files after use for attachment export

does this mean it's only closed if there is an exception?