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 4 of 4
  1. #1
    SHY
    SHY is offline
    New Coder
    Join Date
    Apr 2005
    Location
    Kosice, Slovakia
    Posts
    36
    Thanks
    2
    Thanked 0 Times in 0 Posts

    php safe_mode and uploading

    is it possible to upload files via http into directories created by php while in safe_mode?
    cause ive made a webpage where admin creates a fotoalbum and an appropriate directory is created by php where all the album photos should be stored.
    the problem is that as soon as i try to upload a photo into this directory, move_uploaded_file returns error such as "script whose uid is 1000 cannot access /dir/dir/dir whose uid is 33.." which is weird as that /dir/dir/dir has been created by the same script couple of second before.
    when i try to upload files into directories created manually, it works fine.
    any ideas how to solve this?
    thanks in advance.
    "Programming is an art form that fights back."

  • #2
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    842
    Thanks
    15
    Thanked 9 Times in 9 Posts
    Yes, it is possible to upload via a webpage in safe mode. Make sure the directory you are uploading too is chmod to 777.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #3
    Regular Coder
    Join Date
    May 2006
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post
    You can also use copy instead of move_uploaded_file.

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    copy or move_uploaded_file does not have affect on safe_mode restrictions.

    use move_uploaded_file, because it do some security checks.


  •  

    Posting Permissions

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