Soupermail Folders:  
To: everyone@everywhere
From: vittal.aithal@bigfoot.com
Date: $Date: 2001/02/02 00:48:22 $
Subject: Soupermail File Upload Tutorial

Soupermail File Upload Tutorial

Lots of people get Soupermail because it can do file uploads, then get horribly confused for no apparent reason. Its very simple really, and this tutorial will show you how to do it. It assumes that you've installed Soupermail correctly, and that you have already succeeded in writing a working form with Soupermail. If you haven't, please do the Config File Tutorial.

This tutorial has five steps, and should take no more than 15 minutes to complete.

Step 1

The first step is to understand that file upload requires changes in your form and the form's config file. Also, this tutorial is covering someone with a browser selecting a file on their computer, and using a Soupermail form to send it by email to you. It doesn't save the uploaded file on the server.

Step 2

Now we'll write a simple form.

Make a form like the one below, and save it on your website as myupload.htm.

<html>
<body>
<form method="post" action="/cgi-bin/soupermail.pl" enctype="multipart/form-data">
This is my first file <input type="file" name="myfirstfile"><br>
This is my second file <input type="file" name="mysecondfile"><br>
<input type="hidden" name="SoupermailConf" value="myuploadconfig.txt">
<input type="submit">
</form>
</body>
</html>

Make sure that you change the form's action to the correct value for where Soupermail is installed on your server.

Look closely at the <FORM> tag. Do you see the enctype attribute? If not, look again, because you need to have that in your form to make uploads work correctly. Its really important to remember this.

Step 3

Now, we'll make a simple config file for the form.

Start your favourite editor (eg. Homesite, Frontpage, emacs, vi, notepad), and write the following lines into a file.

mailto: your_email_address@your_domain.com
subject: This is my first Soupermail upload!
mimeon: yes

Obviously, change your_email_address@your_domain.com to YOUR email address.

Do you see the mimeon config command? If not, look again, because Soupermail uses this to figure if uploading is turned on.

Step 4

Now, save the the config file you created in Step 3 into THE SAME DIRECTORY as the form from Step 2, and call it myuploadconfig.txt.

Notice that I'd already specified the config file to use in the form, by putting in a SoupermailConf hidden field.

Step 5

Thats it. Now visit your form in a browser, and submit it. You should receive an email generated by Soupermail containing the files you attached.

Here are the files themselves, if you are still unsure:

Next Steps

Well, with any luck, you should have seen how easy it is to make an upload form. Remember, this is only one aspect of attachments in Soupermail - senderattachments are a way of sending attachments from your webserver out to people. Read up on it in the manual.