I'm about to do something I've never done before. I'm about to write a tutorial dedicated to a command that really...well...doesn't work, to be honest with you. Some of you may be saying I've already done that a few times. Not so--just because you couldn't get it to work doesn't mean it doesn't work for anyone. ;-)
That statement above isn't totally true. This tutorial does work if you set it up correctly, and if the people who are sending you attachments attach the correct types of documents.
You've probably picked up by now that I'm going to go over a form element tag that will allow your users to attach files to your forms. The tag has been available for years now, but I've never gotten around to writing about it because it has always been a total failure. My latest run around the Web seems to confirm that.
The best I've been able to do with the tag is to get text and HTML files to attach to e-mail. By "text," I mean text. Word documents, spreadsheets, and images seem to get crunched when they come through the mail. Oh, they'll open, but the file is often damaged and sometimes arrives in a totally different format than it started. For example, if you send a JPG using this, it ends up a QuickTime movie at the other end. Huh.
However, I get a lot of e-mail about it and I actually have gotten it to work in some cases, so why not write a little tutorial to set the record straight? It is my opinion that this command was never really meant to work with a simple mailto: form. The concept of the command was to have a form element that could attach a file to a packet of information being sent to a CGI. No, I haven't given the CGI side of it much thought.
As a basic form command, it's limited, but it does offer some help. Maybe you'll land upon the correct configuration to allow it to safely send files. The best I, along with a lot of other people on Web newsgroups, could do was to get text to send. I actually feel pretty good about that, because some folks couldn't get anything to go.
Attach SomethingBelow is a basic form that asks for a name and then an attachment. If you click on the Browse button, you'll get a familiar dialog box that will allow you to pick an attachment. Choose your attachment and click Open. You'll see the full path to your chosen file pop up in the box.
Go for it. Just don't submit the form. It isn't set up to send right now. I mean it. Don't click to send the form. I'm serious!