File uploads in safe mode

Discussion in 'PHP' started by Weirfire, Dec 2, 2005.

  1. #1
    I've been trying to build a file upload system on a server which uses safe mode.

    I've been using the function move_uploaded_file() and have been getting the following error

    Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 5622 is not allowed to access / owned by uid 0


    Has anyone ever come across this and knows a workaround for it?
     
    Weirfire, Dec 2, 2005 IP
  2. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #2
    No-one had this problem before? :(
     
    Weirfire, Dec 2, 2005 IP
  3. palespyder

    palespyder Psycho Ninja

    Messages:
    1,254
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    168
    #3
    From what I am reading online you have to have the safe_mode off to use this function. I could be wrong though.
     
    palespyder, Dec 2, 2005 IP
  4. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #4
    Yep, thats what i've found as well.

    Does anyone know how to use PHP's FTP protocol? I've tried using it but can't get it to work with the POST ed variables.

    Love the new avatar by the way ;) lol
     
    Weirfire, Dec 2, 2005 IP
  5. palespyder

    palespyder Psycho Ninja

    Messages:
    1,254
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    168
    #5
    That was at pubcon, I thought I would take a lesson from Crazy_Rob ;) It was snapped with a cell phone though, not a bad pic for a camera phone.
     
    palespyder, Dec 2, 2005 IP
  6. cornelius

    cornelius Peon

    Messages:
    206
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i know what ur problem is cause i got it before

    its obviously a linux system, the file is "owned" by a different user than the script (in your case the script has a uid of 5622 )

    what you should do i CHOWN ur file once its uploaded more here http://uk.php.net/chown

    have a nice day

    oh and whats your upload limit in php.ini?? (you can check it by printinh the phpinfo() )
    php usually defaults to 2mb so u could have troubles there as well
    as well as the script time out time

    FEW MINUTES LATER: oh and hello from west of ireland ;)
     
    cornelius, Dec 2, 2005 IP