PHP - rename error - please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
puzzled
Forum Newbie
Posts: 2
Joined: Tue Oct 26, 2010 4:34 am

PHP - rename error - please help

Post by puzzled »

i'm trying to make a function in order to move images to another folder, i'm using rename function but i have problems on getting it to work.
this is what the error says..

Warning: rename(wp-content/gallery/shirts-gallery/thumbs/thumbs_1288084826.jpg,wp-content/gallery/shirts-gallery/1288084826.jpg) [function.rename]: No error in E:\Xampp\xampp\htdocs\wordpress2\wp-content\plugins\nextgen-gallery\view\gallery.php on line 83

can anyone please help? I don't understand the error :(
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: PHP - rename error - please help

Post by twinedev »

I did a quick check and found this bug report for PHP, the ending message in the thread says it has been updates (July 2009)

http://bugs.php.net/48771

May want to check with whoever maintains your server and see if that is the issue with yours.

Also I found another thread that mentioned at one point in the contributed notes on PHP it was said that this error also comes up on windows systems when the target file already exists. (i couldn't find this, but may be worth checking, do a file_exists() first, if so unlink().

-Greg
puzzled
Forum Newbie
Posts: 2
Joined: Tue Oct 26, 2010 4:34 am

Re: PHP - rename error - please help

Post by puzzled »

thank you for the reply.

I noticed that the error occurs because i'm working it inside wordpress, anyone know how to rename file inside wordpress?
Post Reply