Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Z_ChangeStockCode.php does not rename image file
04-12-2013, 05:48 PM,
#1
Z_ChangeStockCode.php does not rename image file
Hi:

Z_ChangeStockCode.php script does not rename the image file.

In a shared hosted installation (Hostgator), the rename function fails to rename but returns true :-(

Code:
        echo '<br />' . _('Changing any image files');
        if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')) {
            if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg',
                $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg')) {
                    echo ' ... ' . _('completed');
                } else {
                    echo ' ... ' . _('failed');
                }
        }

I already checked that the files exists and it is not renamed, but the echo said "completed", so rename function returned true.

Any clue why?

Regards,
Pak Ricard
Reply


Messages In This Thread
Z_ChangeStockCode.php does not rename image file - by PakRicard - 04-12-2013, 05:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)