On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi together, I'm a bit struggling with FormIt and attachments. My client's hoster asked me some questions I cannot answer him, because I'm not a developer. On my server everything works perfectly, but on the client's server it doesn't.

    The form itself works on the client's server, but all send attachments are received broken or sometimes even not recognized in validation process ("pls. select a file", though there is selected a file!). PDF files won't open and JPGs are corrupted (like a doublet image is inside the image). Perhaps you can help me answering the following questions:

    • What's the path to the script or endpoint, which includes the form logic?
    • Short description, what happens when a form is send. How are attachments handled/ will they be send as they are or does there happen some kind of conversion or so?
    • Which encoding is used in the mails? Is it the same like the DB (e.g. UTF-8)
    • How are the mails send, is it php.mail() or something else? How does php.mail() work on the server?

    Really hope you can help me and you understand what I mean. My English is not really perfect. ;-)
    • All MODX processing is done in its main index.php file. All other scripts (including the FormIt handling scripts) are included into that index.php file as required during processing.

      For handling attachments with FormIt, see http://codingpad.maryspad.com/2011/03/09/modx-revolution-adding-an-attachment-field-to-a-formit-form/

        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
      • In MODX system settings you'll find the email settings (which Formit will use).

        Try using a Gmail/Hotmail account for sending to see if it makes any difference.
        See for Gmail-settings (you'll need an Gmail account of course) https://support.google.com/a/answer/176600?hl=en

        Another important thing when sending files: change the enctype of your form. For example:
        <form action="[[~1~]]" method="post" enctype="multipart/form-data">

        Good luck!
        • I too have just encountered this problem with my site hosted on GoDaddy. Using Formit 2.2.11pl and MODX 2.5.1pl

          The last time we received a .docx file was July, so this could have been broken for some time. It's only since I upgraded to 2.5.1 and been testing did I find it.

          Apache error logs report:
          fcgid:warn] (9)Bad file descriptor: [client ] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function, referer attachment-test.html

          Trying to send a .docx attachment resets the server. I think it's probably a GoDaddy configuration issue, but they're always going to blame the plugin/extra. My most recent support call they insisted that I update my WordPress plugin. I gave up telling them it was MODX formit and up to date! So I'm desperately trying to build a solid case to go back to them.

          I've checked the enctype and it used to work fine previously so I don't know why it wouldn't now and all other file types are fine. doc/pdf/txt etc.

          Any help would be greatly appreciated.
          • I've seen lots of complaints here about GoDaddy.

            My guess would be an issue with mod_security.

            It would not be surprising at all to find mod_security reacting to a .docx attachment, though resetting the server sounds a little extreme. wink
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting