ss2003 Posted November 14, 2006 Share Posted November 14, 2006 When I try to use rename I get an error:Warning: rename(./x.JPG;,./v.jpg;): No such file or directory in /home/content/html/test/index.php on line 27Am I using it correctly? Here is a snip from my code:24 $ext = findexts ($old_name) ; 25 $new_name = str_replace(" ", "-", $new_name);26 $new_name = $new_name . '.' . $ext;27 rename ("./".$old_name, "./".$new_name);Is there some way to specify the current directory? Some syntax error?Thanks! Link to comment https://forums.phpfreaks.com/topic/27229-rename-warning-error/ Share on other sites More sharing options...
blear Posted November 14, 2006 Share Posted November 14, 2006 To specify the current directory, just dont use any directory descriptors, like ./ You might also want to check the filenames as they have to be exact. It also appears that the filenames x.JPG and v.jpg have semicolons at the end, such that they read "x.JPG;" and "v.jpg;"are you sure your funcfion findexts() is working right? Link to comment https://forums.phpfreaks.com/topic/27229-rename-warning-error/#findComment-124505 Share on other sites More sharing options...
ss2003 Posted November 14, 2006 Author Share Posted November 14, 2006 Thanks! it was the extra ; a typo on the form were the iput was collected! Link to comment https://forums.phpfreaks.com/topic/27229-rename-warning-error/#findComment-124517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.