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,

    This probably isn’t much of a MODx question, but might be a Linux/Apache/permissions thing that I just can’t see the wood for the trees with!

    I’ve been experiencing problems in uploading files via Resources > File Manager as well as the FCK Editor when adding images. The File Manager gives the following error when you try to upload a file:
    Failed to copy file to destination directory - upload failed! Possible permission problems - the directory you want to upload to needs to be set to 0777 permissions.
    This happens on all directories - regardless of whether or not the MODx File Manager says "Directory writable? Yes" just above the file upload form. I’ve checked all this via SSH and the directories are set to 777 permissions. All directories are owned by the FTP user that owns the domain, and with the 777 permissions this has always been more than enough to allow file uploads on other MODx sites I’ve developed on the same server. Even changing the owner to be the same user that the Apache HTTPD process runs as on the server has no effect.

    I’ve checked that the admin user has user permissions defined in Security > Manage Users to be able to upload files, file types and write to these directories. I’ve tried using the "use system defaults" checkbox, as well as specifying the directory paths.

    I’ve created a separated PHP script, outside of MODx, that uploads to the "assets/images" folder and this works fine. The files that this script writes to this directory are owned by the "apache" user, and can be accessed and modified fine via MODx. But any file uploads via the MODx File Manager and FCK Editor just result in permissions problems.

    Think I’ve included all the bits of info here from what I’ve tried to get this working, but more than happy to try anything with getting this working!

    Ermm... help!
      • 4310
      • 2,310 Posts
      Have you tried creating a directory via the File Manager and then uploading to it?
      I ask because on one server I had what appears to be an ownership problem where any directories created via FTP were not available for upload by the File Manager, but if I created them from the File Manager everything was fine.
        • 1574
        • 13 Posts
        Yes, I’ve tried that but after the JS prompt for the directory name I get the following message printed to the screen:
        Unable to create folder
        Meant to include this in my original post!