Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation newbie coding problem

    I seem to be having some problems using an upload script i've modified but I keep getting this error:

    File Upload Results


    Image is a JPG

    Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 22072 is not allowed to access /home owned by uid 0 in /home/virtual/site40/fst/home/edward/public_html/process.php on line 46
    File could not be stored.



    I changed the permissions to 777 but it still gives me problems.. anyone have any ideas?
    [you can see what i did by going to edward.infintegrafix.com/upload.html]

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, welcome here.. Please read section 2 here: http://www.codingforums.com/postguide.htm

    The reason this is happening is becuase move_uploaded_file() checks to see if the script being executed has the same owner as the directory you are about to operate on. (only in safe mode)

    What this means is, becuase you do not own the /home directory (this is the directory that contains all the hosting accounts), and safe mode is on, you are being disallowed access... You could try either of these, however i dont know if either will work... If not, you should contact your hosting provider.

    PHP Code:
    <?php
    copy
    ($_FILES['upload_name']['tmp_name'], "your_directory");
    ?>
    Which may possibly work (replace upload_name with your form value name), but could still bring up a problem. This may also work:

    PHP Code:
    <?php
    ini_set
    ('upload_tmp_dir''/folder/on/your/hosting/space');
    ?>
    Place that at the top of your page and then try using the upload script as normal, also ensure you use

    error_reporting(E_ALL);

    to show ALL errors .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •