Contributions

Images (Category Index)
Search: 

image chmod 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.

Expand All / Collapse All

image chmod fix Trusten 27 Feb 2003

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.

Note: Contributions are used at own risk.