We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27444 ☆ A M B ☆
    • 117 Posts
    I am trying to set up an e-mail with an attachment. The attachment is just showing the filename in the received email, instead of being attached.

    This is the Chunk I am using:

    <p class="error">[+validationmessage+]</p>
    
    <form action="[~[*id*]~]" method="post" enctype="multipart/form-data">
    
        <input name="formid" type="hidden" value="TestimonialContactForm" />
        <label for="cfName" style="margin-top:5px;">Full Name:
    
        <p><input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" style="width:250px; margin-top:5px;"/></p></label><br />
        <label for="cfEmail" style="margin-top:5px;">Email Address:
    
        <p><input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" style="width:250px; margin-top:5px;"/></p> </label><br />
        <label for="cfSubject" style="margin-top:5px;">Subject:
    
        <p><input name="subject" id="cfSubject" class="text" type="text" eform="Subject::1" style="width:250px; margin-top:5px;"/></p> </label><br />
        <label for="cfMessage" style="margin-top:5px;"><p><br />Message:</p>
    
        <p><textarea name="message" id="cfMessage" eform="Message:textarea::1:" style="width:250px; height:200px; margin-top:5px;"></textarea></p><br />
        </label>
    
        <p><label for="attachment">Attachment</label>
        <input class="field" type="file" name="attachment" eform="Attachment:file:0:Upload Images Only:#LIST jpg,gif,png " /></p>
    
        <div style="clear:both;"></div>
        
        <br /><br />
        
        <input type="submit" class="gobutton" src="images/gobutton.jpg" name="contact" id="cfTestimonialContact" value="Send"/><br /><br />
    </form>
    


    <p>This is a testimonial sent by <b>[+name+]</b>. The details of the message follow below:</p>
     
    <p>Name: [+name+]</p>
    <p>Email: [+email+]</p>
    <p>Subject: [+subject+]</p>
    <p>Message: [+message+]</p>
    <p>Attachment: [+attachment+]</p>
     
    <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE: Feedback">[+email+]</a></p>



    This is how the email is showing went sent through the form:

    This is feedback sent by John. The details of the message follow below:
    Name: John
    Email: [email protected]
    Subject: Test
    Message: This is a test message!
    Attachment: secondpage.jpg
    You can use this link to reply: [email protected]


    Also, one other question. How can I set the maximum file size for the file to upload?

    Thanks smiley
      Steven James McLean
      Tech Lead
      springbokagency.com
      • 12320
      • 88 Posts
      on my remenber, the size limit is due to php.ini file with the upload_max_filesize = 2M

      an other method seems to make a hidden input (maybe obsolet due to browsers):
      <input type="hidden" name="MAX_FILE_SIZE" value="2097152">

      but i have no information about the priority of this settings
        Thanks to the authors of the following code :
        Easy Newsletter (module)
        SiteMap (snippet)
        Codepress (Plugins)
        Strict URLs (Plugins)
        Virtual Aliases (Plugins)
        Maxygallery (snippet)