Help manually attaching a image to resource

Well-known member

In an add-on I'm working on I have to manually attach a file to a resource.
I had it working by manually copying to the file to the data directory, and inserting the various bits into the xf_attachment and xf_attachment_data tables but thought that was a bit messy.