The 'FILE' keyword is required in this context, when the attachment is a file.
#2171 Compile-time error
The 'FILE' keyword is required in this context, when the attachment is a file.
Explanation
This error is caused by wrong syntax, like
using output as "foo.txt"
The proper form is
using output as file "foo.txt"