Jump to content

Delete .tar Archive


steinhauserc

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/292019-delete-tar-archive/
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.