We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34727
    • 3 Posts
    I am attempting to make an addition to my internal site here where I’d like my users to be able to select a pdf from a drop down list and have it included in the email that gets sent out. Everything I’ve seen so far involves uploading the file from the form, not using one that’s already on the server.

    can anyone be of assistance on this? I’ve got the emails working and when i use the code for uploading a file it sends as an attachment file. So I know the backend stuff is working...

    Anyways, if I could get some help i’d be forever grateful!

    Here’s my thinking, but I am not getting anywhere with it... The file i’m trying to select and send as an attachment is in the root of the www folder, called "UserGuide.pdf" in the future I would have like 20 files in there... anyways, can someone help? as you can see i tried numerous ways of setting the value etc....

    <label>
    Select your form:

    <select name="contact_attachment" value="[[!+fi.contact_attachment]]">
    <option value="">Select an option...</option>
    <option value=’./UserGuide.pdf’ [[!+fi.contact_attachment:FormItIsSelected=`one`]]>One</option>
    <option value="UserGuide.pdf" [[!+fi.contact_attachment:FormItIsSelected=`two`]]>Two</option>
    <option value=UserGuide.pdf [[!+fi.contact_attachment:FormItIsSelected=`three`]]>Three</option>
    </select>
    </label>

    Thanks
      • 34727
      • 3 Posts
      so is there no way to include a drop down with a file list to attach? i keep trying various things and am not having any luck.

      I believe i must just be missing something... anyone care to chime in?
        • 3749
        • 24,544 Posts
        Is this form in the front end?

        What, exactly, is happening when you try that?

          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
          • 34727
          • 3 Posts
          Yes I was putting this in the main form front end that also included an area for a comment/email address. The form type had been changed so it would be the type that supported an email with file (enctype="multipart/form-data"> ). If I simply used the code used in this thread http://modxcms.com/forums/index.php?topic=48354.0 I would get the option to upload a file and the file would come through in the email.

          however when I started modifying the code to have a drop down box of files instead, it wouldn’t ever send an attachment through, the email would come, just attachment-less.

          thanks for any help you can provide on this... in that other thread, it sounds like formit should handle the file attachment fine but so far I am stumped.

            • 3749
            • 24,544 Posts
            Me too (stumped). Maybe someone else who has done it can chime in.
              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