App sending mail with attachment

I created an app that take an input from user and save it to file and I need to send this file by email.
File was created in a folder private for application and I need to save it to public (shared) folder.
How can force app to write file in a specific folder ?