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? Quote Link to comment 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"); Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.