Hello Everyone,

I am working on a script that will allow (administrative only) users to
upload some images for their site, but I am running into one problem.
When I upload the images, they are owned by the user & group of the
webserver. I have seen this be a pain in the arse for other programs
(like Gallery), so I was trying to come up with a way around this.

I did come up with this (in the PHP upload page):

PHP Code:
if (move_uploaded_file($fileName,$dest)) {
  if (! chown($dest,fileowner($_SERVER['PHP_SELF']))) {
    echo "Ownership change for $dest failed";
  }
} else {
  echo "Move of file $fileName failed";


This will only be accessed by administrative users who have had to log
in to access this page.

Does anyone see anything wrong with trying to do this on uploaded files?

Does anyone have a better solution/suggestion for handling this?
--
Doug

Registered Linux User #285548 (http://counter.li.org)
----------------------------------------
Random Thought:
Booze is the answer.  I don't remember the question.



The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning.



YAHOO! GROUPS LINKS




Reply via email to