Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Z_ChangeStockCode.php does not rename image file
04-12-2013, 05:48 PM
Post: #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
Find all posts by this user
Quote this message in a reply
Post Reply 


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

Forum Jump:


User(s) browsing this thread: 1 Guest(s)