The positioning of the past participle adjective is related both to the context of the sentence and to the preposition introducing the phrase.
Note, as your examples illustrate, that phrases introduced with some prepositions, including with and for tend to place the modifier after the noun:
With the file attached....
With your eyes closed ....
For the reasons given....
For the time required....
Also, the placing of the modifier can change the meaning:
Answer the questions with the text book closed....
is subtly different from
Answer the questions with the closed text book.
And if you were to write:
Send the email with the attached file.
The meaning could be understood as Send the email with the file that I have attached rather than **send the email with the (relevant) file attached to it.
As a general rule, adjectives precede nouns. But when past participle adjectives follow nouns, it is also because the construction represents a shortened form:
With the file attached (to it)
For the reasons (that have been) given
For the time (that is) required
With your eyes (having been) closed