We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11054
    • 59 Posts
    I’m looking to create a file repository where specified web users can upload files that will then be displayed in list form on a page - something similar to a Google Groups type environment.

    Two things:
    1) Can I use a front end editor and restrict it to only give web users ability to upload files (.doc, .pdf, etc.) to a designated folder? Is there a way to prompt the FCKEditor file uploader without going through the QuickEdit window?

    2) For displaying the files I wanted to use Ditto, but I can’t seem to figure out how to direct it to a server folder. Can you do this? Seems like it does, but I’m new to some of this stuff. If Ditto doesn’t do this, what does?

    Thanks in advance!
      • 3749
      • 24,544 Posts
      This will let users upload files in the front end: http://modxcms.com/extras/package/149. I think there may be others as well.

      I don’t think you can get ditto to display files (though I could be wrong). You could use a template variable with @DIRECTORY, but
      I think you’ll probably want a custom snippet to read and sort the filenames with a few tpl chunks to display them.
        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
      • You can also use a TV of the input type "File". Then you could use Ditto with the link URL made from the TV value in the Ditto chunk tpl.
          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
          • 11054
          • 59 Posts
          Gotcha on the TV type "file."

          Can you give me an example of what the Ditto template chunk tpl would look like if I wanted the files displayed in a list? Seems like using TV’s would mean that you would need a TV for each individual doc.... Am I confused here?
          • Ah, I missed the part about it being on the front-end. You could use a simple form with a file upload field and any other fields you want, such as a description, and during the process insert metadata from the form into a database table (such as user ID if these users will be logged in), then use another snippet to read that table and make your list.

            What about the FileCabinet snippet? It’s pretty old, but I’ve been using it successfully for years (other than a few bugfixes; follow the forum posts)
            http://modxcms.com/forums/index.php/topic,2897.msg20394.html#msg20394
              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
              • 11054
              • 59 Posts
              That link doesn’t seem to be working, or at least I don’t have permission to view it.
              • Hm. You’re right. It was originally developed to use as a repository for the MODx site. I’ll see if it’s available anywhere else...
                  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
                  • 11054
                  • 59 Posts
                  Quote from: sottwell at Aug 04, 2009, 06:16 AM

                  Ah, I missed the part about it being on the front-end. You could use a simple form with a file upload field and any other fields you want, such as a description, and during the process insert metadata from the form into a database table (such as user ID if these users will be logged in), then use another snippet to read that table and make your list.

                  Thinking through this briefly, what about using NewsPublisher with a File TV to create a page for each file. Then, as you said, use Ditto to list out each file along with a brief summary of the file?

                  Anyone have a simpler way to accomplish this?
                    • 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
                      • 11054
                      • 59 Posts
                      Seemingly a much simpler solution! Thanks for the help. I’ll be back if/when I have questions putting this together.