Attach an uploaded file

Sometimes when spinning up a new site, especially a multi-site, you need to make sure to populate some attachments. Here is a function to make this easier.

If you want to do this for a single file upload you can call this function like so:

If you want to use this to upload multiple files in an upload: