Posted by Jason Nugent on August 10, 1998 at 09:57:31:
In Reply to: Attaching file to form mail posted by Janus Boye on August 10, 1998 at 07:06:49:
: I received the following question on the HTML FAQ:
: How do you attach a file to form mail? And is it possible to
: attach more than one file? I have read the documentation found at WC3 but I end up encoding all the data I want to send and it just doesn't get through to me as the data for my email gets encrypted also.
: Any help would be greatly appreciated,
To attach a file to a Form, you need to use the <input type="file"> tag. This creates a way to browse your hd and pick a file to send along with the regular form information.
I assume that the reader meant formmail, the popular CGI script for sending files? If so, I don't believe the script can handle the file-uploading input tag. You need to alter the enctype to multipart/form-data, and then extract the information differently in the script by parsing for the file boundary, and I'm not sure formail can do this.
If you are unable to develop this yourself, I should point you to the CGI.pm perl module which is excellent and provides some functions for decoding files that have been uploaded. Or, you could write one yourself. Perhaps a future article of mine :)