Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: allowing form uploading

by George_Sherston (Vicar)
on Oct 15, 2002 at 17:33 UTC ( #205443=note: print w/ replies, xml ) Need Help??


in reply to allowing form uploading

I can understand your reluctance to use modules or, for example, 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.

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 install your own choice of modules) - cubesoft in the us or uklinux in uk are good.

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 not personal.

George Sherston

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 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 start_multipart_form() method. Forty-five minutes reading the docs on CGI and Mail::Sendmail will be time well spent. Enjoy! And please come back here with any problems you encounter.


Comment on Re: allowing form uploading
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://205443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-08-23 02:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (171 votes), past polls