I have a HTML page that has form fields and a field to upload. I have been having trouble getting my files to upload. I searched for "uploads" and found a lot of good information, but for some reason I cannot get it to work eamil me anything. Here is my code for the cgi:
#!/usr/local/bin/perl -w use CGI; # load CGI routines use Mail::Sendmail; $q = new CGI; @names = $q->param; $name = $q->param('name'); $company = $q->param('company'); $address = $q->param('address'); $city = $q->param('city'); $state = $q->param('state'); $zip = $q->param('zip'); $phone = $q->param('phone'); $fax = $q->param('fax'); $email = $q->param('email'); $comments = $q->param('comments'); $file = $q->param('file'); print $q->header, # create the HTTP header $q->start_html(-title=>'Email Sent', -BACKGROUND=>'http://65.108.100.28/images/bkg3 +.jpg', -LINK=>'blue', -ALINK=>'maroon'), # start the HTML "<p align=\"center\"><font size=\"6\">Thank you<br><br></font +>", "<font size=\"7\">Your Email has been sent to stu96art@yahoo. +com</font>", # level 1 header '</p>', '<br><br><br><br>', "<p align=\"center\">Click here go to the <a color=\"blue\" h +ref=\"http://65.108.100.28/index.html\">home page</a><br><br>", "<p align=\"center\">Click here return to the <a color=\"blue +\" href=\"http://65.108.100.28/contact.html\">contact page</a><br><br +>", "<p align=\"center\">The values you sent were</p>", $q->h2("NAME: $name\n<br> COMPANY: $company\n<br> ADDRESS: $a +ddress\n<br> CITY: $city\n<br> STATE: $state\n<br> ZIP: $zip\n<br> PH +ONE: $phone\n<br> FAX: $fax\n<br> EMAIL: $email\n<br> COMMENTS: $comm +ents\n<br>"), $q->end_html; # end the HTML use MIME::Lite; $msg = new MIME::Lite From =>'technicu@technicut.net', To =>'stu96art@yahoo,com', Cc =>'some@other.com, some@more.com', smpt =>'64.176.60.59', Subject =>'A message with 2 parts...', Type =>'multipart/mixed'; attach $msg Type =>'TEXT', Data =>"NAME: $name\n COMPANY: $company\n ADDRESS: $add +ress\n CITY: $city\n STATE: $state\n ZIP: $zip\n PHONE: $phone\n FAX: + $fax\n EMAIL: $email\n COMMENTS: \n \n $comments"; attach $msg Type =>'image/gif', Path =>"$file", Filename =>"$file"; $msg->send;
I was also wondering how I could download any file, possible not just a .gif file. I would look to download .dxf, .cad (drawing files), but be able to upload any type of file. Is this possible? Thanks.

In reply to email and upload by stu96art

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.