hello i was hoping someone could help me out,
i am trying to upload an image with a form and then copy it to the images directory with copy($fupload,$upload_directory); function but i am gettign a safe mode warning like:
Warning: SAFE MODE Restriction in effect. The script whose uid is 22038 is not allowed to access /home owned by uid
but if you look at this open source software oscommerce in the admin page on catagories.php it uploads & copies a picture using a copy statement a different way i had to track this back to 3 differnt pages:-on catagorires php oscommerce.con it uses a tep_copy_uploaded_file() function defined in general.php that uses a move_uploaded_file() function defined in compatability.php and then it uses return copy($file, $target); i tried return copy() in my script and copy() but i keep getting this safe mode warning could anyone tell me how oscommerce gets through the safe mode so i could do that with my script?? thanks alot.
catagories.php
$categories_image = tep_get_uploaded_file('categories_image');
$image_directory = tep_get_local_path(DIR_FS_CATALOG_IMAGES);
if (is_uploaded_file($categories_image['tmp_name'])) {
tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . $categories_image['name'] . "' where categories_id = '" . tep_db_input($categories_id) . "'");
tep_copy_uploaded_file($categories_image, $image_directory);
includes/general.php
function tep_copy_uploaded_file($filename, $target) {
if (substr($target, -1) != '/') $target .= '/';
$target .= $filename['name'];
move_uploaded_file($filename['tmp_name'], $target);
compatability.php
if (!function_exists('move_uploaded_file')) {
function move_uploaded_file($file, $target) {
return copy($file, $target);
my script:
if (isset($fupload))
{
print "path: $fupload";
print "name: $fupload_name";
copy($fupload,"$file_dir/$fupload_name");
}
thanks alot