Forum Moderators: open

Message Too Old, No Replies

Form to e-mail w/attachments

I am lost on this one

         

dhdweb

7:35 pm on Aug 31, 2002 (gmt 0)

10+ Year Member



I need to set up a form where users can attach a file that gets sent to me via e-mail.

The cgi script I am using is supplied by my host and I believe it is based on Matt's script.

Setting up the form in html for the attachments is not the problem, but rather getting the var setup in the textfile or the cgi file is where the problem lies.

All I know is that I don't know what to do next.

<fixed typo>

bobriggs

8:10 pm on Aug 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi dhdweb.

You're not going to be able to use anything like Matt's script for this.

To start with, for file uploads, the html form must use multipart/form-data encoding, which is a completely different animal than application/x-www-form-urlencoded, which is what a script of this type can read.

multipart/form-data encoding will require cgi.pm or something similar to read the variables. Then the next problem is forming the correct email headers to attach the file, and probably then hex encoding the original attachment.

Unless you want to write it yourself, you might find something you need on some of the free script sites around.

dhdweb

8:58 pm on Aug 31, 2002 (gmt 0)

10+ Year Member



I didn't think it would be easy!

Thank you