Prevent CF7 attachment from being deleted [closed]

Looking at submit() in WPCF7_Submission we see a call to remove_uploaded_files() which has no filter to stop it. So apparently what you are trying to do isn’t meant to be done by the author of CF7.

So apart from getting the author to include a hook there the only way I see is that you generate your file and then create a copy before adding it to the form submission so your original file stays.