We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39969
    • 5 Posts
    I know Revo does a lot of unzipping, however, I can't find a way to unzip files in file manager. Do I have to enable something in settings? Or is there something I'm missing?

    Thank you in advance
      • 40045
      • 534 Posts
      I'm not aware of any possibility to do this via the manager, if you find a way, let me know, would sometimes be very handy!
      • hitko123, this is not a part of the MODX Revolution core at this time. I am assuming you're uploading zips to specific directories? Could you explain the types of assets you're uploading and how you're using them?
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
          • 39969
          • 5 Posts
          Quote from: smashingred at Jun 10, 2013, 04:33 PM
          hitko123, this is not a part of the MODX Revolution core at this time. I am assuming you're uploading zips to specific directories? Could you explain the types of assets you're uploading and how you're using them?

          It's not about assets. It's just that I'd like to upload an archive with something like 100 files, then extract it on the server, rather than uploading all those files manually. First, it's way faster to upload a single file because it only takes one FTP request to do that, second, I don't want to give FTP access to site publishers. Since Revo has 2 built-in unzipping scripts, I was wondering if there's a way to use them for zip files from the "files" tab.
          • There are gallery add-ons that do this, but the Revo file manager doesn't have such a function.

            By the way, any files that are accessed separately, like .js or image or .css files, are considered "assets".
              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
            • You can also take a look at Packman in the Repository, depending on your needs and implementation.

                Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                • 39969
                • 5 Posts
                So, I've written an unzip browser processor, which works when I run it using
                $modx->runProcessor('browser/file/unzip', array('file'=>$filename));
                Now the question is, how to add the trigger to the right-click menu in file browser. Any idea?
                • First, find the code for the menu. Then see how the other menu items work.
                    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
                  • I'm looking into adding an unzip item to the menu, and would be very interested in your processor, if you would be willing to share it.

                    You can add menu items to the context menu in the core/model/modx/sources/modfilemediasource.class.php like this:
                    $menu[] = array(
                        'text' => $this->xpdo->lexicon('file_download_unzip'),
                        'handler' => 'this.unzipFile',
                    );


                    Of course, it would need a lot more in the way of checking what kind of file it is, and what permissions the user has...
                      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
                    • Hm. There already is an unzip processor, core/model/modx/processors/system/filesys/file/unzip.php

                      I have the context menu item, now to figure out how to hook it to the unzip processor.
                        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