Results 1 to 2 of 2

Thread: Help with PHP move_uploaded_file

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Location
    UK
    Posts
    7

    Default Help with PHP move_uploaded_file

    I am trying to upload a file using PHP Post Method Uploads, but I get file Permision errors:

    Warning: move_uploaded_file(/hsphere/local/home/cd163601/back2bikes.ukpages.org/forsale/3_sm.jpg): failed to open stream: Permission denied

    The script I am using is:

    $uploaddir='/hsphere/local/home/cd163601/back2bikes.ukpages.org/forsale/';
    $uploadfile=$uploaddir . "3_sm.jpg";
    move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile);

    I have tried changing the destination path to:
    var $uploaddir = '../forsale/';
    but still no success.

    Can anyone help me please?
    Regards
    Colin Davis

    Email: webmaster@ukpages.org
    Web: http://www.ukpages.org/

  2. #2
    Happy Steadfast Client
    Join Date
    Jan 2006
    Location
    Miami, Fl
    Posts
    125

    Default

    I would make sure that the forsale directory has write permissions for everyone. Or maybe if you set the group on that folder to apache then you can just give group access to write to that directory. You need to have write access on the directory to create a new file.
    [ JUSTIN ]
    [ justechnology llc ]
    [ WEB DESIGN / DEVELOPMENT, TECHNICAL CONSULTING, & BUSINESS WEB HOSTING
    ]
    [ when will apple? ]
    [ GUESS THE RELEASE DATE AND GET THE SCOOP ON APPLE'S NEW PRODUCTS
    ]

Posting Permissions

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