Jump to content

rename()


jandrews3

Recommended Posts

I know someone's gonna paste me for this, for I certainly know NOT what I do ... but ... shouldn't the following code when executed change the name of a file called test2.pdf in a directory called documents to rename_test.pdf?

<?

$old_name = "test2.pdf";
$new_name = "rename_test.pdf";
rename("/documents/".$old_name, "/documents/".$new_name);


?>

Link to comment
https://forums.phpfreaks.com/topic/197015-rename/
Share on other sites

I'm afraid the file does exist (I've verified it with my ftp client and also by loading it by URL in a browser) and it is properly placed in the documents folder. Could there be a server setting that doesn't allow renaming files which might give this response?

Link to comment
https://forums.phpfreaks.com/topic/197015-rename/#findComment-1034251
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.