Our Image Gallery... allows users to attach GIF or JPG files to their post. The hack checks the headers to make sure it's the proper format and also limits the size of the file that can be uploaded. It then takes the image they uploaded and places it in their post.
Another way to do the attachments would have it accept any format and simply write it to the server drive and provide a link-- this way people could exchange zip files, docs, etc. For us, all we need are images