Reputation: 3
when i'm extacting a zip-Archive that contains a subfolder with some Images in it, then the directory is not created. Instead the Directory-Name is now part of the filename ?!
This makes no sense to me at all?
ImageFiles\
The Result of extractTo would be a file in the root directory named 'ImagesFiles\Image1.jpg'
Any ideas on how to create this ImageFile folder when extracting the files ?
Thanks in advance
Upvotes: 0
Views: 286
Reputation: 1
This problem happens because DIRECTORY_SEPARATOR
is different in Windows and Linux.
You can replace the separator value with the separator of the operating system before extracting using a loop and functions getNameIndex
and renameIndex
and function str_replace
.
Upvotes: 0