adige Posted November 23, 2010 Share Posted November 23, 2010 <?php $zip = new ZipArchive; $res = $zip->open('test.zip'); if ($res === TRUE) { $zip->renameName('currentname.txt','newname.txt'); $zip->close(); } else { echo 'failed, code:' . $res; } ?> I can rename a text file name but I can't rename a folder name.Can you help me? Link to comment https://forums.phpfreaks.com/topic/219552-rename-a-folder/ Share on other sites More sharing options...
nilansanjaya Posted November 23, 2010 Share Posted November 23, 2010 tried this way ? rename("folder1/old","folder1/new"); Link to comment https://forums.phpfreaks.com/topic/219552-rename-a-folder/#findComment-1138299 Share on other sites More sharing options...
adige Posted November 23, 2010 Author Share Posted November 23, 2010 yes I have tried but I can't it in the Zip file Link to comment https://forums.phpfreaks.com/topic/219552-rename-a-folder/#findComment-1138305 Share on other sites More sharing options...
nilansanjaya Posted November 23, 2010 Share Posted November 23, 2010 im not sure that a folder can be renamed inside a zip file. so i suggest you could extract it , make the change's and compress it back to a zip , unless some other person give's you a better solution Link to comment https://forums.phpfreaks.com/topic/219552-rename-a-folder/#findComment-1138307 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.