I am using the PHP zipArchive class to uncompress files and store them on a server, but I have a couple of problems
extractTo method only returns true开发者_如何学运维 or fales, I need a list of the file names and types to that I can
- Check they are valid file types for the function
- Connect the files with database objects for retrieval
Any ideas?
you can extend the class, adding a logging function which then passes through the params to the extractTo method...
see: http://php.net/manual/en/keyword.extends.php
Answering my own question for completeness, the DirectoryIterator is the best way. The process being:
- Create Temp folder
- Extract
- Check with DirectoryIterator class
- Move to Permanent location
- Delete Temp folder
精彩评论