topmate Posted January 29, 2003 Share Posted January 29, 2003 When uploading product images via the admin section my December snapshot sets the file permissions to owner read and write only, giving no public access. Essentially this means I am met with a page of broken links. I've searched through the forums and found nothing specific on this. I'm able to get around it by deleting the images and re-uploading via FTP, but its an untidy solution at best. Is there a way to allow the images to be uploaded with different file permissions when I'm adding products via admin? Link to comment Share on other sites More sharing options...
TB Posted January 29, 2003 Share Posted January 29, 2003 Mark, Apply the following change to your admin/includes/functions/general.php file (around lines 780 - 790). Find this: // the $filename parameter is an array with the following elements: // name, type, size, tmp_name function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); } Replace with this: I have commented where the chmod change has been made for easy reference. // the $filename parameter is an array with the following elements: // name, type, size, tmp_name function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); // chmod added - start chmod ("$target", 0776); // chmod added - end } This should sort out your problems... :D Post again to thread if you're still having problems. Cheers, Tony "The price of success is perseverance. The price of failure comes much cheaper." Link to comment Share on other sites More sharing options...
topmate Posted January 29, 2003 Author Share Posted January 29, 2003 That's cracked it Tony, thanks, you're a star! Wouldn't have worked that one out by myself a loooonnnng time! :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.