While trying to upload zip files created in MacOS with checked Unpack ZIP Archives option to the Media Library using Upload Files (Advanced) dialog, the following error message is displayed:
Exception has been thrown by the target of an invocation
The issue occurs when trying to process *.jpg files from the _MACOSX folder as images. The _MACOSX folder contains resource forks that are generated when a MacOS user creates a .zip file. They cannot be processed correctly and the process fails.
To resolve the issue, delete the __MACOSX folder before uploading.