We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33992 ☆ A M B ☆
    • 455 Posts
    i can upload files into only folders that changed to 0777. i must change all folder i want to upload into, is this work secure for site?
    i can’t delete and edit files in all folders even 0777s.

    it makes me tired and crazy.
      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you want a script to be able to upload files, the folder must be 777 so the script can write to the folder. When a script uploads a file, however, that file belongs to the user the script runs as (apache, www, nobody - whatever user the apache server runs as). The uploaded file will not by default be 777 when it is uploaded. Your FTP user (you) will not be able to edit or delete these files; you’ll need to use another script (such as the MODx Manager’s file manager) to access them.

      For this reason, I have for years made sure that any host I use has PHP running as CGI/suexec instead of as an apache module. This causes the script to change user to my FTP user (me) when it runs, so now it has access to all of my folders without having to make them 777. Any files the scripts upload will belong to the user the script runs as, in this case me, so I have full access with my FTP user.
        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
        • 33372
        • 1,611 Posts
        Quote from: albert_hp at May 05, 2007, 05:06 AM

        i can upload files into only folders that changed to 0777. i must change all folder i want to upload into, is this work secure for site?
        i can’t delete and edit files in all folders even 0777s.

        In general, when you set a folder’s permissions to 777 this doesn’t change the permissions of the files that are already there within it. If you already uploaded files via FTP, they will still have the server’s default permissions unless you change them for each file as well. Files that you upload via the File Manager, however, should automatically have the correct permissions set (so you’ll be able to edit/delete those without changing anything).

        As for security, setting 777 permissions on shared servers can sometimes be a risk if the server is improperly configured, infected with a worm, etc., but it’s a very common practice (and necessary on most standard setups). Susan’s suggestion about getting a host that offers suexec takes care of that issue, but many hosts still don’t offer it. If yours doesn’t, just follow the other security-related instructions in the documentation (setting register_globals to off, for example) and you’ll be fine.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 33992 ☆ A M B ☆
          • 455 Posts
          I thank you first.
          i am new modx user (not a professional user!) and i had no problems with it yet.
          i don’t understand, WHY did it happen? i change nothing and i’ve used modx-defualts with no problem. huh huh
          i just add DHTML script (from ajaxify tutorial) and remove it after it , i have too bad problems. any idea to restore to dreamy days :’(? can re-installing help? will my pages and datas miss after re-installing?

          Regards
          AHHP
            God loves me. 【ツ】


            MODX.ir (Persian Support)

            Boplo.ir/modx/ (Persian)
            • 33372
            • 1,611 Posts
            This problem couldn’t possibly have anything to do with the DHTML script that you installed, so I wouldn’t go looking there for insight. It seems to me as if you just need to make sure that you follow the installation steps exactly, since setting these permissions is a necessary part of the process. It doesn’t sound to me as if you’re encountering anything abnormal really; you just need to doublecheck that your permisions are right and keep in mind that when you upload files via FTP you probably won’t be able to delete/edit them using the File Manager unless you also set their permissions to 777 after uploading them.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 33992 ☆ A M B ☆
              • 455 Posts
              Hi;
              -I have unsolved-probIems because i can’t find the core of problem. i know that adding a js file can’t do that but i REALLY have changed NOTHING (promise wink).

              -I can’t edit/delete any files in file manager: files in 777 folders, uploaded files even MODx files like PHPs but i could do these work later.
              (i used MODx demo at opensourcecms.com, it’s File Manager is like mine(demo-user can’t change anything).)

              -I thank you for guiding. grin

              -Would you suggest me a powerful & easy way to solve it quickly for ever because i’m not professional and i will face new problems in hard ways wink laugh.

              Thanks alot
              AHHP
                God loves me. 【ツ】


                MODX.ir (Persian Support)

                Boplo.ir/modx/ (Persian)
                • 33372
                • 1,611 Posts
                The only files that you will be able to edit or delete in the file manager are the ones that you have uploaded via the file manager (or if you specifically edit those files’ permissions after uploading them via FTP). The file manager is not meant to be used for much more than just easy uploading of images, Flash, and other files that you want to insert on your pages, so it sounds to me as if you might just be trying to do something with it that it’s really not intended to do. You definitely should NOT be able to edit the MODx PHP files via the file manager, since that would be a huge security risk.

                What is it that you’re trying to edit exactly?
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 33992 ☆ A M B ☆
                  • 455 Posts
                  Ok,i understand.

                  you help me well. grin
                  THANK YOU ALOT


                  REGARDS
                  AHHP
                    God loves me. 【ツ】


                    MODX.ir (Persian Support)

                    Boplo.ir/modx/ (Persian)