CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:



Jan 31, 2000, 11:12 AM

Post #1 of 5 (2261 views)
mime Can't Post

i made a very simple Form Processing script to get mail from users that drop by. How would i include an additional text form into the script to allow people to upload a file/send an attachment? I did some research, figured out i needed something called mime, but's all i know. Can anyone help?


Feb 1, 2000, 6:29 PM

Post #2 of 5 (2261 views)
Re: mime [In reply to] Can't Post

There are many ways to upload files, and everyone has a prefrence. This is what I found at

CGI::BasePlus RmpO Extra CGI::Base methods (incl file-upload)

This may help you.

Let us know.

Brian Hayes


Feb 3, 2000, 3:56 AM

Post #3 of 5 (2261 views)
Re: mime [In reply to] Can't Post

thanks brian, Borderline, i'll look over them. Just one final question, is mime that much of a difficult thing? Can't it be simply incorperated into a perl script not using only a couple lines?


Feb 3, 2000, 10:33 AM

Post #4 of 5 (2261 views)
Re: mime [In reply to] Can't Post


For doing the attachment check out MIME::Lite. It is all Perl so you can do a local install if you do not have root access to the server.

Also CGI by it's self will handle the upload too.



Feb 3, 2000, 9:20 PM

Post #5 of 5 (2261 views)
Re: mime [In reply to] Can't Post

Mime::Lite is a single Perl script that will do all your attachement and email header work for you. You just tell it what to do and it does it.
But if you insist on doing it your self you will need to read RFC 822. Also do some tests of your own to find out how to form the email header. Open an email with an attachment in pico or notepad and look at the header and how it handles the multipart message. You will also need to know what encoding to give each type of attachment eg <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

Use encoding: If your message contains:
7bit Only 7-bit text, all lines <1000 characters
8bit 8-bit text, all lines <1000 characters
quoted-printable 8-bit text or long lines (MUCH more reliable than "8bit")
base64 Largely binary data: a GIF, a tar file, etc.
This is discussed on the MIME::Lite page somewhat.



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives