steinhauserc Posted October 23, 2014 Share Posted October 23, 2014 In a webpage I am making a tar.gz file to download to the user. The file gets to the user perfectly fine but in the process I make a .tar archive and .tar.gz file on the server. I am able to delete the tar.gz file with 'unlink($targzFile);' but I am not able to delete the archive. I have tried treating the archive like a folder and removing all items in the folder and then deleting the folder with 'rmdir($folderName);' as seend below but that hasn't worked for me. $files = glob($tarName. "/database/*"); foreach($files as $file) { if(is_file($file)) unlink($file); } rmdir($tarName . "/database"); rmdir($tarName); Does anyone have any suggestions? Thanks. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted October 23, 2014 Share Posted October 23, 2014 Show us how you are doing the two unlinks. Are you getting an error message from the failed delete? Do you have php error checking on? 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.