SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    UK
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem uploading files in PHP

    Hi,

    I've written code to upload a file in PHP....

    <input type=\"file\" name=\"file\" size=\"50\">

    then...

    $upload = copy("$file", "../images/$file_name");

    Now this works in one site I've done, but in another (on a different server/webhost), I just get the Unable to create, Permission Denied error message.

    I've got the chmod of ../images/ set to 755 which works for the other site, but not for this one. It does work with the chmod set to 777, but I reckon it wouldn't be safe to leave it like this!

    Thanks in advance,
    Eman.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    UK
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just got some info from PHPINFO(); ...

    upload_tmp_dir:
    local value: no value
    master value: no value

    file_uploads:
    local value: 1
    master value: 1


    I'm well stuck on this, and need to get it sorted urgently, any help would be appreciated

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    UK
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not sure why it wasn't working, probably some server permission thing which i don't understand... anyway if anyone's having similar problems, it can be solved by using ftp in php


Bookmarks

Posting Permissions

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