note 53796 rejected from function.move-uploaded-file by betz

From: Date: Mon, 13 Jun 2005 20:55:55 +0000
Subject: note 53796 rejected from function.move-uploaded-file by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90374@lists.php.net to get a copy of this message
Note Submitter: jimmygoon at gmail dot com ---- I'm really going out of my mind. I have a random picture script that is beyond the scope of this message but at one point it lets a user upload a file via the code: foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; $name = $_FILES["pictures"]["name"][$key]; move_uploaded_file($tmp_name, "userfiles/".$_POST['username']."/$name"); if(chmod("userfiles/".$_POST['username']."/$name", 0777)) { chown("jimmyjoe"); echo "successfully changed permissions"; } else { echo "UNFADFASDFAsdf"; } } } As you can see I'm "chown"ing the file afterwards and it DOES set the permissions correctly (I can confirm this via FTP) But I, as the admin, can not delete the picture (or therefore the folder containing it)... so right now my users can create and upload pictures etc and I have no way of deleting them... What should I do?

« previous php.notes (#90374) next »