I'm just investigating/testing:
I edited the "upload files" behaviour and changed the FILE field FROM "[filename]" to "<?php echo $_SESSION['insID']; ?>[FileName]".
But the session is not inserted because the session is created from the Insert record server behaviour that is just below the "upload files" behaviour in the server behaviours panel.
So, I tried to move the code of the "upload files" behaviour just below the Insert record server behaviour code.
Result: the email file attachement is renamed correctly (sessione ID + filename).
BUT now the file field in the insert record is empty.
I think this is due to moving the "upload files" code below the "insert record" code.
Is there to make it work in email and insert record?