We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1574
    • 13 Posts
    Hi all,

    I’m having a couple of problems with the MODx Resources Browser on one of my sites. Whenever you try and use it to add an image to a page content, or upload new images, you can view the subdirectories within assets/images/ on the server, but you cannot see any of the files. I’ve double checked that the assets/images/ directory has FTP permissions, and when viewing via FTP you can see the images, HTML files and a couple of other random files in the directory.

    As well as not being able to see images in the Resource Browser, when you try to upload any type of file (tried PNG, JPG, GIF etc.) you get a dialog box saying that the file type is not allowed.

    The following is from the Configuration screens in MODx, and all looks OK to myself:

    Interface & Features:
    - Resource path: /kunden/homepages/39/d212630859/htdocs/assets/
    - Resource URL: assets/
    - Uploadable Image Types: jpg,jpeg,png,gif,psd,ico,bmp
    - Uploadable Media Types: mp3,wav,au,wmv,avi,mpg,mpeg
    - Uploadable Flash Types: swf,fla

    File Manager:
    - File Manager Path: /kunden/homepages/39/d212630859/htdocs
    - Uploadable File Types: txt,php,html,htm,xml,js,css,cache,zip,gz,rar,z,tgz,tar,htaccess,mp3,mp4,aac,wav,au,wmv,avi,mpg,mpeg,pdf,doc,xls,txt,png,jpg,jpeg,gif,mov,avi,rm,qt

    Has anybody else had any similar problems to this, or could shed any light on the situation it would be very much appreciated!

    Many thanks,

    Andrew
      • 7231
      • 4,205 Posts
      Normally this is due to a bad path. But you are already aware of this so this is no help. I would recommend double checking if the paths are correct. Also if you are using a manager user that you created (other than the main admin) check to see that it is configured to use the same path as the admin or it’s own custom path (there is a check box that needs to be selected in the individual manager user settings).

      The resource path is the one that controls the resource browser.

      Stick this in a snippet and see if it returns the path that you have entered:
      <?php
      return $_SERVER['DOCUMENT_ROOT'];
      ?>
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 1574
        • 13 Posts
        Hi,

        This returned "/kunden/homepages/39/d212630859/htdocs" which is the same as set as the Resource Path. MODx had set exactly this in the Resource Path, and I added "/assets/" onto the end so that it was looking in the right directory, but even without "/assets/" on the end it was still just showing subdirectories, and not showing files huh

        I’ve got the ability to view the subdirectories as well as rename, create and delete these as I would expect, but just no files!
          • 7231
          • 4,205 Posts
          If you can see/edit the directories then it is not a path issue. Could it be a file ownership issue? Try uploading a file with the Resource Browser’s upload feature and see if it works.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 12808
            • 70 Posts
            Check my post (last one), I had similar problem:
            http://modxcms.com/forums/index.php/topic,4578.msg148726.html#msg148726
              --
              www.spotkg.com
              • 1574
              • 13 Posts
              Hi guys,

              Thanks for the suggestions but no luck as of yet. I’ve double checked the file and directory ownerships, and have created a simple PHP script to test that the user the Apache process runs as can access and write to directories, so normal file uploads and browsing works via a simple PHP script, but just no luck with using the MODx resource browser to do so!

              I’ve also tried replacing the index.html in assets/images/ as described in http://modxcms.com/forums/index.php?PHPSESSID=2c4a8bb6b8e78d90a6e6736267a89376&topic=12563.15 and the .htaccess mod in manager\media\browser\mcpuk\connectors\php

              It’s nothing to do with maximum file size as I’ve been testing using 5Kb image files!

              There doesn’t seem to be any Javascript or XML errors as mentioned in a couple of threads that have similar problems.

              I’m just really confused as to why the "Error, ’disallowed file type’" error message is appearing when .jpg files are declared as allowed in the MODx config, but even though I’m uploading a .jpg file I get this message huh

              Is there a way I could export the configuration of MODx (v 0.9.6.1p2) from this server (PHP 5.2.5 with MySQL 5.0.32) so that someone can double check there’s nothing that I’m overlooking in the basic configuration?
                • 22303 MODX Staff
                • 10,725 Posts
                There are system settings and user settings to control allowed file types. Make sure jpg is in your user’s list or the user’s list is being ignored in favor of the system settings.
                  • 1574
                  • 13 Posts
                  Thank you so much - looks like that was exactly what was wrong! grin

                  Once the invoice for this client site is paid, I’ll make sure there’s a slice of that heading towards the MODx Paypal account! I think it’s only fair to donate to such an awesome project and support!