The problem with your first option is that having the attachment control appear between options will cause the subsequent options to jump around the page. In some instances this may even cause some options to be out of sight (off the bottom of the display). Overall, this can contribute to a confusing experience for the user, and is best avoid whenever possible.
Option 2 avoids the problem of option 1, and you might be able to implement it exactly as in your example and it should be fine.
However, I will mention a small downside to option 2: it isn't immediately obvious that the attachment control is associated with the selected answer, and perhaps doesn't even need to be acknowledged by the user.
Sure, most users will probably make the association based on the fact it is only visible when you select the "as attachment" option, but for some users it may not be as obvious.
Therefore my suggestion would be that you aim for option 2, but you restyle the attachments control to make it look like an additional "question". Having it look like an additional question keeps it consistent, and helps the user to identify that it is also a requirement of the form. It also give you the chance to explicitly state what type of file should be attached (e.g. a certification).
Also, as Danielillo mentioned in the comments, it might make sense to re-order your answers to suit this situation.
Here is an example:
