We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hell thanks for this plugin, it works great!

    I have a form where people van send a mail with an attachment, but for now it is very unsafe, they can send any file they want...

    I would like to know where the attached files are uploaded (witch folder) and if these are removed automatically?


    How do I:

    - Make only pdf and word files uploadable?
    - Make the max filesize 1MB?
    - Maybe even check MIME types?

    here my code:
    [[!FormIt?
    
        &hooks=`spam,email`
        &emailTpl=`MyEmailChunk`
        &emailTo=`[email protected]`
        &emailFrom=`[email protected]`
        &emailReplyTo=`[email protected]`
        &validate=`name:required, email:email:required, subject:required, text:required:stripTags`
    ]]
    

    <h2>Contact Form</h2>
    <p>[[+fi.error.error_message]]</p>
    <form class="form" action="[[~[[*id]]]]" enctype="multipart/form-data" method="post">
    <input name="nospam:blank" type="hidden" />
    <label for="name">
    Name:
    <span class="error">[[+fi.error.name]]</span>
    </label>
    <input id="name" name="name" type="text" value="[[+fi.name]]" />
    <label for="email">
    Email:
    <span class="error">[[+fi.error.email]]</span>
    </label>
    <input id="email" name="email" type="text" value="[[+fi.email]]" />
    <label for="subject">
    Subject:
    <span class="error">[[+fi.error.subject]]</span>
    </label>
    <input id="subject" name="subject" type="text" value="[[+fi.subject]]" />
    <label for="text">
    Message:
    <span class="error">[[+fi.error.text]]</span>
    </label>
    <textarea id="text" cols="55" rows="7" name="text">[[+fi.text]]</textarea>
    <label for="resume">CV bijvoegen:
    <span class="error">[[+fi.error.resume]]</span>
    </label>
    <input id="resume" name="resume" type="file" value="[[+fi.resume]]" />
    <br class="clear" />
    <div class="form-buttons">
    <input type="submit" value="Send Contact Inquiry" />
    </div>
    </form>
    
      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
      • 28215
      • 4,149 Posts
      They’re not uploaded anywhere besides how PHP handles it (the PHP configured tmp/ dir). They are removed when the script is done.

      The other suggestions can be done with a postHook. You could also add a feature request here: http://github.com/splittingred/FormIt/issues/

        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com