Click to See Complete Forum and Search --> : cgi script for a form to send a file to an email


uticka
05-02-2003, 01:26 PM
HI,

I'm sure this has been created, but I can't seem to find it.

I have created a form which the site visitor will fills out and the information is send to my email address. (typical form)

I need to have a way for the site visitor to also browse his hard drive and send (upload?) a file which will attach to the email the form is sending me...

Is there a way to do this?

Thanks!

jeffmott
05-02-2003, 04:52 PM
The form control can be created simply enough: an input element of type file. For parsing the uploaded data (and all other CGI parameters) you should use the CGI (http://www.perldoc.com/perl5.8.0/lib/CGI.html) module. Then see MIME::Lite (http://search.cpan.org/author/YVES/MIME-Lite-3.01/lib/MIME/Lite.pm) for generating the multipart e-mail message.