We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26277
    • 8 Posts
    Hi there!
    I’m trying to make form with possibility to multi uploads at once.
    I’ve found nice jQuery Multiple File Upload Plugin and I was trying to get it work with eForm.
    Unfortunetly the plugin’s default behaviour generates an array of elements, so input must be like this: <input id="filesUpload" class="multi" type="file" name="attachments[]" accept="pdf|txt|doc|rtf" maxlength="5" eform="Attachments:file:1::" /> . And here I have a problem because eForm returns array in mail. The problem is array: attachment[].
    Any ideas how I can get it work without hacking core? Maybe there is another solution for making eForm with multi upload thing?
    Thanks for help in advance!
      • 30223
      • 1,010 Posts
      Hmm, you’ve hit one of eForm’s limitations, sadly it only handles single upload fields. Without changing the core eForm snippet it would at best require an ugly work around.

      I’ll have to think about this... I have no time today I think, but will have a look for a more complete answer when time permits.


        • 26277
        • 8 Posts
        TobyL, Thank you for your interest.
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          I hate to bring up an old topic, but has this issue been given any more thought? I just got a project that needs multi upload and would rather a nice solution like this instead of me hacking together something.

          Thanks,
          AMDbuilder
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 20488
            • 353 Posts
            I hate too, but I’m also really interrested in. smiley
              • 26
              • 17 Posts
              huh please help
                • 23510
                • 168 Posts
                Would it make sense to use a plain html form that goes to a snippet with php code to handle the files and form data? I’m not doing the multi file thing but in the next couple days I’ll be doing upload functionality for web users. The files will be saved in folders that match the user’s id and also be suffixed with 8 random characters - something that can’t be done with eform.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Sure it can. Use the &eFormOnBeforeMailSent event to write your own function to deal with the FILES array and move the file where you want it. The function will also have any other arrays like SESSION available. Just add the javascript/Flash uploader in your eForm form tpl (I favor Uploadify).

                  http://modxcms.com/forums/index.php?topic=36994.0
                  http://modxcms.com/forums/index.php/topic,8111.15.html
                    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