Link to home
Start Free TrialLog in
Avatar of mksalva
mksalva

asked on

Can I Add an "Upload File" Feature to HTML Submit Form?

I have a simple Submit form on our organization's network, and I receive the form results in my e-mail.

This is a VERY SIMPLY HTML SUBMIT FORM. How tough would it be to add the option where users can attach files to the form?

Thx,
Mike
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mksalva
mksalva

ASKER

Most of the HTML from my current form is listed below. (I have X'd out the names and e-mail address.)When the form is submitted, I receive a simple e-mail that has a subject line that reads "Form posted from Microsoft Internet Explorer."

In case it matters, this form is only on our network, and only people in our organization have access to it. We all have Outlook, so the e-mail is sent via Outlook.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>"The Blue Form" - Submit a Web Request</title>

</head>

<body background="html_images/blue-texture.jpg">
<p>&nbsp;</p>
<table width="800" border="0" align="center" cellpadding="8" cellspacing="0" bordercolor="#16788D" bgcolor="#58cae4">
  <tr>
    <td background="html_images/box-bkgd2.gif" bgcolor="#16788D"><strong><font color="#FFFFFF" size="5" face="Verdana, Arial, Helvetica, sans-serif">The Blue Form<br>
      <font color="#000000" size="3">TBC Web Site Request Form </font></font></strong></td>
  </tr>
  <tr>
    <td><form action="mailto:xxxx@xxxxxxxx.org" method="post" enctype="text/plain" name="form1">
      <p><strong><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">If you have any files that must accompany this web request, please put them in the Shared/Web folder, or e-mail them to XXXX XXXXX.</font></strong></p>
      <table width="98%" border="1" align="center" cellpadding="6" cellspacing="2" bordercolor="#FFFFFF">
        <tr>
          <td><center>
            <font face="Arial, Helvetica, sans-serif"><strong><em><font color="#FFFFFF" size="3">NOTE: If this request is for an event not yet listed on the web site's Calendar of Events, please send the details to XXXXX XXXXXXXXX for approval first. This also applies to major changes to existing events, such as date or location change.</font></em></strong></font>
          </center></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="8">
       
        <tr>
          <td width="40%" align="right"><strong><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif">Your Name</font></strong></td>
          <td width="60%"><input name="Name" type="text" size="60"></td>
        </tr>
        <tr>
          <td width="40%" align="right" valign="top"><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Web Request Title </strong></font></td>
          <td width="60%"><input name="Web Request" type="text" size="60"></td>
        </tr>
        <tr>
          <td width="40%" align="right" valign="top"><p><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Name and web address of existing page to be edited</strong></font></p>
            <p><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Please include details, and indicate the location and names of applicable files.</font></p></td>
          <td width="60%"><textarea name="Existing Page" cols="60" rows="7"></textarea></td>
        </tr>
        <tr>
          <td width="40%" align="right" valign="top"><p><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Create New Page</strong></font></p>
            <p><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Please include details, and indicate the location and names of applicable files.</font></p></td>
          <td width="60%"><textarea name="Create New Page" cols="60" rows="7"></textarea></td>
        </tr>
        <tr>
          <td colspan="2">
            <input type="submit" name="Submit" value="SUBMIT WEB REQUEST!">
            <br>
            <em><font color="#000000" size="3" face="Arial, Helvetica, sans-serif"><strong>IMPORTANT! After clicking the Submit button, please select &quot;OK&quot; and &quot;Yes&quot; to allow your Outlook to send an e-mail to XXXX XXXXX </strong></font></em></td>
          </tr>
      </table>
    </form>    </td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
<form action="mailto:xxxx@xxxxxxxx.org" method="post" enctype="text/plain" name="form1">

Yeah, this won't work for file uploads, because there is no scripting method to handle the file.  You need to enable PHP or ASP on the server and write a script to handle this form.  Alternately, you can use Perl or Python if that's easier to install.  Perl's cgi.pm module has a good file upload handler...
Forced accept.

Computer101
EE Admin