Im making a screenshot archive (so far going great!) and anyway, I have users upload files from browser, which works fine, and goes to /user_uploads/ (chmod 777)
Now I have a queue system as part of my admincenter, and it allows me to reject or accept the images, accepting them adds them and blah blah...
Anyway, in the process of adding them it creates the file in /screenshots/ but it does not copy the image correctly, Ive set /screenshots/ to chmod 777 like the other dir, but it still doesnt copy right.
I did a propertie info on normal images that appear correctly (they are chmod 644) now the ones causing problems seem to be chmod 755 .. I think this has something to do with it but im not sure
Here is my code:
if ($add) {
if ($type == "screenshot") {
$queue_dir = "/home/darktid/public_html/user_uploads/";
$screen_dir = "/home/darktid/public_html/screenshots/";
mysql_connect($scriptaz->server, $scriptaz->db_user, $scriptaz->db_pass);
mysql_select_db($scriptaz->database);
$temp = mysql_fetch_array(mysql_query("SELECT * from pic_queue WHERE id='$add'"));
// Check if file already exists
if (file_exists("$screen_dir"."$temp[file]")) {
$rename_file = "$temp[user]_$temp[file]";
}
else {
$rename_file = "$temp[file]";
}
// Add to archives
copy($queue_dir, "$screen_dir"."$rename_file");
$time = time();
mysql_query("INSERT into archives (time,title,author,type,data,url,review,reviewer,downloads,rating) VALUES ('$time','$temp[title]','$temp[user]','screenshot','$temp[data]','$rename_file','NA','NA','0','0')");
// Delete file from queue dir
unlink("$queue_dir"."$temp[file]");
mysql_query("DELETE from pic_queue WHERE id='$add'");
echo "<center><b class='color'>$temp[title]</b> by <b class='color'>$temp[user]</b> added to screenshots archive.<br><br>You are now being taken back to the picture queue.</center>";
$scriptaz->redirect("pikture_queue.php",2);
}
-- No SQL error, just does not seem to copy the image data correctly, I basically need to move /user_uploads/image.jpg/bmp/png/gif to /screenshots/image.jpg/bmp/png/gif
Any ideas? Thanks alot ....