note
George_Sherston
I can understand your reluctance to use modules or, for example, [http://nms-cgi.sourceforge.net/|scripts written by others] - understand, but not condone. It really *is* worth making the effort to get up the learning curve so you can do this. I speak as one who wasted time and effort not doing this for a long time. The fab thing about Perl is that for most of the things you want to do, someone else has already thought through the problem and written stuff to help you do it better. CPAN is your friend, and worth geting to know. <BR><BR>You say your webhost doesn't allow you to use non-standard modules. Please don't let this stand in your way. Most of the modules you will want *are* standard by now. Or, on the other hand, there are many free or cheap webhosts that let you do what you want (for example [id://177773|install your own] choice of modules) - [http://www.csoft.net/|cubesoft] in the us or [http://www.uklinux.net|uklinux] in uk are good. <BR><BR>Finally, I encourage you not to be touchy about a vigorous critique of your code. Would you rather people sugar-coated it and didn't tell you what was really wrong? Anyway, a good beasting from [merlyn] as well as being good for the soul is very much a rite of passage around here. It's [id://205373|not personal].<br><br>§ <A HREF="http://www.sprogress.com">George Sherston</A>
<BR><BR>PS in answer to your substantive question I wouldn't dream of doing this without a module. [Mail::Sendmail] handles attachments, though not in a very memory-friendly way. See [http://alma.ch/perl/Mail-Sendmail-FAQ.htm#attachments|this faq] for more. Then you'll need a form field in your original form, and you'll need to use CGI.pm to help you manage processing the form once uploaded. NB that you will want your form to be a multipart encoded form - if you're generating your form from CGI.pm, you can set this up using the <code>start_multipart_form()</code> method. Forty-five minutes reading the docs on [cpan://CGI] and [cpan://Mail::Sendmail] will be time well spent. Enjoy! And please come back here with any problems you encounter.
205424
205424