Possibly this will help:
The case is slightly different from yours: attaching a file directly to a specific invoice.