Menu

Safemode in PHP

Help
marco
2006-07-07
2013-03-21
  • marco

    marco - 2006-07-07

    Hi Marek,

    I've told you before that my provider creates the problem with my uploads. They've sent me the next message;
    Standard are our servers under safemode in PHP. We suggest you the next script:

    upload.php
    <?php
       if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
           move_uploaded_file($_FILES['userfile']['tmp_name'], "/usr/local/psa/home/vhosts/domeinnaam.nl/httpdocs/test/" . $_FILES['userfile']['name']);
           echo "Bestand geupload!";
       }
    ?>

    upload.html
    <form enctype="multipart/form-data" action="upload.php" method="post">
    Upload dit bestand: <input name="userfile" type="file">
    <input type="submit" value="Upload!">
    </form>

    Where in OFB can I change the script so that it will upload under safemode?

    Many thanks already, Marco

     
    • Marek Blotny

      Marek Blotny - 2006-07-10

      Hi Marco,

      First of all, sorry for late answer, I'm on vacations right now :)

      But I have checked safe mode on my computer and upload seems to be fine ... could you send me more details about problems which you are facing? Additionally maybe you could also post your configuration and all setting related to safe mode from php.ini?

      Cheers, Marek

       
    • marco

      marco - 2006-07-14

      Hi Marek,

      I've just received an answer from my provider. You can see the php.ini through http://www.goedkoopste-training.nl/trainers/test/phpinfo.php (this is off course confidential info!!)
      The only problem is that I can't upload files to a new created directory. The rest works fine.

      Thanks already and again for your efforts! Marco

       
      • Marek Blotny

        Marek Blotny - 2006-07-18

        Hi Marco,

        Thanks for additional details, I have problems with testing that ... could you tell me one more thing, what's the permissions of newly created directories?

        BTW I'm back so now we should solve this issue really soon :)

        Cheers, Marek

         
        • marco

          marco - 2006-07-19

          Hi Marek,

          First, I hope that you had a nice holiday? The permission is 0777, because every user need to have access after login.

          Cheers, Marco

           
          • Marek Blotny

            Marek Blotny - 2006-07-21

            Hi Marco,
            Yes holidays were great, thanks for asking :)

            I have added new feature to OFB, after creation of directory or file, chmod function is called in order to change permissions. I hope it will solve your problems. Permissions for directories and files are configurable in system.properties. The code is already in CVS, can I ask you to checkout the latest version and verify if it works for you? I don't have access to any instance of PHP with safe mode on so I can't do it on my own. If you will face any problems with CVS I can send you the CVS version of OFB as a attachment.

            Cheers,
            Marek

             

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.