Ido Naveh Ido Naveh -4 years ago 79
PHP Question

DS_Store file is created on ZipArchive::extractTo

I'm creating a PHP script, which supposed to extract a zip archive stored on the php file directory to a folder.

Everything works well, but when I check te result, I find 2 folders under the directory: a folder with the name of the zip archive, and another folder named

. I don't know how this folder came there, especially as I'm using Windows 7. Second, in each folder there is a file called

Now, I don't know how these things got there. This is my code:

$zip = new ZipArchive;
if ($zip->open('')) {
$path = getcwd() . "/details/" . trim($id) . "/";
$path = str_replace("\\","/",$path);
echo $path;
echo $zip->extractTo($path);
echo 'ok';
} else {
echo 'failed';

This is the only code that extracts the zip file, or touching it, and as you can see, there is nothing like

Can you please help me?

Answer Source originated on a OSX system. __MACOSX and .DS_Store have 0 usage or bearing on any other OS. Delete / Ignore them and keep trucking.

As an aside, you may want to add the stated file system objects to your project .gitignore.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download