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:
"I'd love to go out with you, but I'm converting my calendar watch from
Julian to Gregorian."



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




SPONSORED LINKS
Php mysql Job postings


YAHOO! GROUPS LINKS




Reply via email to