xplorer4d Posted February 18, 2004 Posted February 18, 2004 When I add new categories and products, it uploads the images on the server with permission set to 600 = they are not displayed. How can I correct this problem? Thank you. :lol:
xplorer4d Posted February 18, 2004 Author Posted February 18, 2004 Found it in forums. Beautifully simple. Thanks fmahannah (and Trusten for posting it in contributions) :D Image upload Fix **************************************************************** this fix was posted by fmahannah. I had nothing to do with it. however, i don't think anyone posted it as a contribution and let's face it, you have to hunt to find it, so i decided to paste it. No need to download, cuz here goes. edit the function tep_copy_uploaded_file in admin/includes/functions/general.php Find the function tep_copy_uploaded_file and where it now shows: function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); } Change it to: function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); // Added by F Mahannah to fix permissions on uploaded files which were being set to 600 chmod($target, 0644); } point is, it will change the chmod to something OTHER than 600. which means we'll all be able to back up our images, which we haven't been able to do in the past.
mr.eyetee Posted February 20, 2004 Posted February 20, 2004 when i look in admin/includes/functions/general.php i can't find function tep_copy_uploaded_file($filename, $target) { if (substr($target, -1) != '/') $target .= '/'; $target .= $filename['name']; move_uploaded_file($filename['tmp_name'], $target); } i'm running the version 2.2. is there something i'm doing wrong? ;)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.