Attributes of uploaded files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pedja
    Senior Member
    • Mar 2004
    • 329

    #1

    Attributes of uploaded files

    I have a script that worked fine for more than a year. Suddenly it started making problems. I think it started after server update.

    What happens is that, when file is uploaded through the form, it gets 600 atribute so it is not accessible via web. I even tried to force 644 after saving file, but it remains 600.

    Each time my client uploads file he must access file through FTP to change file attribute manualy and that is very annoying, both for him and me.

    Is there something I can do to allow files to be visible?

    Code I use is like this:

    Code:
      if (! move_uploaded_file($_files['f_uploadedfile']['tmp_name'], $putfile)) {
    	  return 0;
    	}
      } else {
            chmod($putfile, 664);
            return 1;
      }
  • Buddha
    Senior Member
    • Mar 2004
    • 825

    #2
    Try an octal value:

    Code:
      if (! move_uploaded_file($_files['f_uploadedfile']['tmp_name'], $putfile)) {
    	  return 0;
    	}
      } else {
            chmod($putfile, 0664);
            return 1;
      }
    Yes, that's a zero.
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

    Comment

    Working...