To administer your WestHost account, please enter your
Domain Name or Server Manager Username.

WestHost: Professional Website Hosting Company








Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1

    Default Formmail.php with attachments

    I am using formmail.php and it works great for processing forms with required fields and conditions, and emailing the results.

    I ran into a problem when I tried to enable attachments. The required fields and conditional testing works fine.

    However, I receive the email form results but with no attachment. I get an additional email with the error message:
    Code:
    The following error occurred in FormMail :
    File upload attempt ignored
    I only have one formmail.php file uploaded (renamed to tugourshirts.php)
    I checked my php.ini file and ran php_info.php - both confirm that
    Code:
    file_uploads = On
    Any help would be GREATLY appreciated!

    You can see the form online here: http://www.motherhoodwithattitude.co...o.php?agree=on
    Code:
    <form method="post" action="http://www.motherhoodwithattitude.com/contactus/tugourshirts.php" name="WhatAHam" enctype="multipart/form-data" />
        <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
        <input type="hidden" name="recipients" value="contact@motherhoodwithattitude.com" />
        <input type="hidden" name="required" value="email:Your email address,realname:Your name" />
        <input type="hidden" name="subject" value="What a Ham!" />
        <input type="hidden" name="releaseterms" value="agreed" />
        <input type="hidden" name="good_url" value="http://www.motherhoodwithattitude.com/thankyou.php" />
        <input type="hidden" name="conditions1" value=":@
       @IF@first_photo@first_photo~/^.*\.(jpg|jpeg|gif|png)$/i@@You can only upload graphics files@" />
    
        <table border="0" cellspacing="5%">
        <tr>
            <td><p><strong>Name:</strong></p></td>
            <td><input type="text" name="realname" />
            </td>
            <td><p><strong>Email address:</strong></p></td>
            <td><input type="text" name="email" />
            </td>
        </tr>
        <tr>
            <td valign="top" colspan="4">
        <p><strong>Upload photo: </strong><input type="file" name="first_photo" /></p>
            </td>
        </tr>
        <tr>
            <td valign="top" colspan="4">
            <p><strong>Tell us the story about this photo:</strong></p>
            </td>
        </tr>
        <tr>
            <td colspan="4"><textarea name="story" rows="10" cols="50" ></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center"><input type="submit" value="Send the photo" class="button" /></td>
        </tr>
        </table>
    </form>
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  2. #2

    Default

    I just submitted the form twice and then checked my logs

    Access Log:
    Code:
    66.1.107.31 - - [16/Jan/2007:13:10:31 -0700] "POST /contactus/tugourshirts.php HTTP/1.1" 302 525 "http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
    66.1.107.31 - - [16/Jan/2007:13:10:32 -0700] "GET /thankyou.php HTTP/1.1" 200 3265 "http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
    66.1.107.31 - - [16/Jan/2007:13:11:46 -0700] "POST /contactus/tugourshirts.php HTTP/1.1" 302 525 "http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
    66.1.107.31 - - [16/Jan/2007:13:11:46 -0700] "GET /thankyou.php HTTP/1.1" 200 3265 "http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; r
    Referer log:
    Code:
    http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on -> /contactus/tugourshirts.php
    http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on -> /thankyou.php
    http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on -> /contactus/tugourshirts.php
    http://www.motherhoodwithattitude.com/uploadphoto.php?agree=on -> /thankyou.php
    Nothing in the error log for that submission time, but these 4 messages keep appearing in my error log. They seem unrelated to this problem since these occured 2 minutes before I submitted the form for testing the first time.
    Code:
    [Tue Jan 16 13:07:44 2007] [notice] caught SIGTERM, shutting down
    [Tue Jan 16 13:08:35 2007] [notice] Apache/1.3.27 (Unix)  (Red-Hat/Linux) PHP/5.1.2 configured -- resuming normal operations
    [Tue Jan 16 13:08:35 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)
    [Tue Jan 16 13:08:37 2007] [warn] (95)Operation not supported: setsockopt: (TCP_NODELAY)
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  3. #3

    Default

    More information...

    I've looked at the php file itself, and here's the code for the error message:

    Code:
    		// MSG_FILE_UPLOAD is sent in an Alert message when
    		// file upload is attempted but FormMail is not configured to allow
    		// it
    		// Parameters: none
    	$aMessages[MSG_FILE_UPLOAD] = 'File upload attempt ignored';
    I'm not sure what configuration value I am missing...
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  4. #4

    Default

    If I can't get this working, I'm open to suggestions on how to allow site visitors to email files...
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  5. #5
    Senior Member rolling's Avatar
    Join Date
    May 2004
    Location
    Different day, different place
    Posts
    486

    Default

    There is obviously something wrong with your script. Where did you get it from? The standard frommail.pl installed from the site manager breaks when I add the ENCTYPE="multipart/form-data" to the form declaration. Very strange

    --
    when I add ENCTYPE="multipart/form-data", formmail.pl has blank values for Recipient, Subject, EMail and Name - ''
    Richard

    I have jotted down some of my meddlings at http://www.rollingr.net/wordpress
    Click here for a full list of formatting codes for this forum

  6. #6

    Talking

    Quote Originally Posted by rolling
    There is obviously something wrong with your script. Where did you get it from? The standard frommail.pl installed from the site manager breaks when I add the ENCTYPE="multipart/form-data" to the form declaration. Very strange

    --
    when I add ENCTYPE="multipart/form-data", formmail.pl has blank values for Recipient, Subject, EMail and Name - ''
    I got the script from http://www.tectite.com/formmailpage.php

    formmail.pl is a Perl script

    formmail.php is a PHP script

    The script works great EXCEPT for the attachments, so I don't think that there is anything seriously wrong with it. You need to specify the encode type in order to add files. As far as I know, formmail.pl has never been able to do that. The error isn''t coming from adding the ENCTYPE, it's coming from the fact that formmail.pl doesn't handle anything except for text.

    According to the W3:
    The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data
    Thanks for looking into it, though.
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  7. #7

    Red face Whoops...

    I am a YAHOO.

    I did changed the configuration to allow uploads, but I didn't upload the file after I changed it.

    I'm a dork.

    It's working great now.
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  8. #8
    Senior Member rolling's Avatar
    Join Date
    May 2004
    Location
    Different day, different place
    Posts
    486

    Default

    Glad you fixed it.
    I didn't mean to confuse you by referring to formmail.pl instead of php - all I wanted to point out was that you weren't using the standard form and that we couldn't help without having access to the source.
    Richard

    I have jotted down some of my meddlings at http://www.rollingr.net/wordpress
    Click here for a full list of formatting codes for this forum

  9. #9

    Default

    I tried to post the source code, but it had too many characters for one post. :shrug:
    Affordable, Professional Websites
    www.Maida.Net

    Healthy Mind, Body and Soul
    www.TheHealthyMom.com

    Your Friendly Neighborhood Comic Store
    www.BargainComics.com

  10. #10
    Senior Member rolling's Avatar
    Join Date
    May 2004
    Location
    Different day, different place
    Posts
    486

    Default

    Yes it is rather large with all those comments. I had found the source here

    I also found an archived post from WildJoker which says that Formmail.pl does not support attachments. He recommended TFMail which is a better written replacement for the standard formmail.
    Richard

    I have jotted down some of my meddlings at http://www.rollingr.net/wordpress
    Click here for a full list of formatting codes for this forum

Similar Threads

  1. Uebimiau and attachments
    By gsenechal in forum E-mail / FTP Management
    Replies: 3
    Last Post: 01-02-2006, 09:14 AM
  2. Not getting emails with attachments?
    By maida in forum E-mail / FTP Management
    Replies: 2
    Last Post: 12-27-2005, 11:51 AM
  3. UebiMiau attachments & images
    By MitchellSTL in forum E-mail / FTP Management
    Replies: 0
    Last Post: 09-21-2005, 10:22 AM
  4. Email attachments not being received
    By jpc in forum E-mail / FTP Management
    Replies: 6
    Last Post: 11-04-2004, 07:04 AM
  5. Filtering email with attachments?
    By ian in forum E-mail / FTP Management
    Replies: 20
    Last Post: 08-23-2003, 12:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •