Attach a created file

Attach a created file

Our application creates pdf files based on information in the database.  Is there a way to attach this file to the database via script or email after it is created or when it's being created?