[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

How to allow users to upload a file - via an email form - using a Perl script?

Asked by bobbyg1986 in Perl Programming Language

Tags: perl

Ok, here is what I am trying to do ..

I have a standard type of Perl script that is parsing the information that comes in from an HTML form.  Such as name, address, phone, email address, etc.  But, I simply want to allow the user to browser through their computer and locate a file (on their computer) and include the file as an attachment to their email - when it is sent to me.  For example, if someone wanted to attach a Microsoft Word copy of their resume along with their email.

What do I need to include in my Perl script ... and HTML form - that will allow this to work ... and also operate securely and handle possible error messages, etc., etc.

Here is my standard code.

Please let me know how to modify my Perl script (and HTML form) so I can incorporate the addition of a FILE attachment to the email.

Thanks.

HERE IS MY CURRENT PERL CODE:


#!/usr/local/bin/perl

&get_form_data();
&send_email;
&print_thankyou_page;

sub get_form_data

 {
     # Get the input
     read(STDIN, $buffer, $ENV{ 'CONTENT_LENGTH' } );

     # Split the name-value pairs
     @pairs = split (/&/, $buffer);
     foreach $pair (@pairs)

 {
          ($name, $value) = split(/=/, $pair);

          # Un-Webify plus signs and %-encoding
          $value =~ tr/+/ /;
          $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
          hex($1))/eg;
          $value =~ s/<!--(.|\n)*-->//g;
          $FORM{$name} = $value;
     }
 }


sub send_email
 {

     $to = "my\@emailaddress.com";
     $mailprog = '/usr/lib/sendmail';

   open(MAIL,"|$mailprog -t");
   print MAIL "From: $FORM{'email'}\n";
   print MAIL "To: $to\n";
   print MAIL "Subject:  Email Message \n\n";
     # print out the form results
   print MAIL "First Name: \t$FORM{'first_name'} \n\n";
   print MAIL "Last Name: \t$FORM{'last_name'} \n\n";
   print MAIL "E-mail Address: \t$FORM{'email'} \n\n";
   print MAIL "Status: \t$FORM{'status'} \n\n";
   print MAIL "Other \(if other is selected for Status\): \t$FORM{'other'} \n\n";
   print MAIL "Comments: \t$FORM{'comments'} \n\n";
   print MAIL " \n";
   close(MAIL);
 }


sub print_thankyou_page
 {

     print "Content-type: text/html\n\n";
     print "<HTML>\n<HEAD>\n</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\">\n";
     print "<font face='arial, verdana, helvetica' color='#336699'><H3>THANK YOU SUBMITTING YOUR INFORMATION.</H3>\n\n";
     print "<P>\n";
     print "We have received your comments and will forward this to the webmaster.<BR><BR><BR>\n";
     print "Click below to return back:<BR>\n";
     print "<B><A HREF=\"http://www.ourwebsite.com/\" TARGET=\"\_top\">Our Company</A></B></font><BR><BR>\n\n\n";
        print   "</BODY>\n</HTML>";
 }



The HTML page can be found at:

http://www.piccorp.com/hr_feedback_form.html

=============================================

I'd greatly appreciate some help on how to add this feature.

Thanks ...
Gary

PS:  Depending upon what is involved to help me with this, I'd be very willing to increase the amount of points.  Just let me know.


[+][-]01/31/01 11:27 AM, ID: 204307Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/31/01 11:50 AM, ID: 5800066Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/31/01 02:27 PM, ID: 5800466Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/31/01 03:33 PM, ID: 5800658Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/31/01 03:58 PM, ID: 5800705Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/31/01 04:11 PM, ID: 5800712Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/31/01 11:19 PM, ID: 5801422Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 04:29 AM, ID: 5802101Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 09:14 AM, ID: 5802855Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 09:27 AM, ID: 5802909Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 09:48 AM, ID: 5803023Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 09:49 AM, ID: 5803026Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Perl Programming Language
Tags: perl
Sign Up Now!
Solution Provided By: maneshr
Participating Experts: 3
Solution Grade: A
 
[+][-]02/01/01 10:35 AM, ID: 5803206Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 11:07 AM, ID: 5803357Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 11:35 AM, ID: 5803489Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 12:12 PM, ID: 5803602Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 12:28 PM, ID: 5803664Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 12:40 PM, ID: 5803694Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 02:36 PM, ID: 5804014Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 02:40 PM, ID: 5804031Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 03:20 PM, ID: 5804161Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/01/01 04:05 PM, ID: 5804245Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/01/01 09:23 PM, ID: 5804729Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/02/01 04:26 AM, ID: 5805758Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/02/01 09:05 AM, ID: 5806723Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/02/01 10:05 AM, ID: 5806977Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/06/01 11:58 AM, ID: 5818430Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/06/01 12:00 PM, ID: 5818441Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/06/01 12:54 PM, ID: 5818583Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/06/01 01:07 PM, ID: 5818610Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/06/01 01:40 PM, ID: 5818691Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/06/01 04:25 PM, ID: 5819155Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/10/01 06:03 AM, ID: 5830776Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/10/01 04:52 PM, ID: 5831415Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/10/01 05:01 PM, ID: 5831425Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81