Good question. Unfortunately, I can't think of any easy way to achieve this in current version. A zip file will display with a zip icon, while an image will display and open as an image. There is no internal logic to bypass this, as it would require some pre-defined pattern. Either an image file would link to a zip file with the same name, or a zip file would load an image file with the same name as preview.
Hack #1
The only thing I can think of, would be to create a redirect rule (for instance in .htaccess if Apache). Let's say you have image dir/filename_zip.jpg
you could then create a rule that looks for *_zip.jpg
and redirects to filename.zip
. You would have to assign click to open new window (instead of attempting to load the image into the popup). Also, you would likely want to hide the zip file from the dir, unless it's located in another dir unavailable to Files? You would then need to rename them _files_filename.zip
(starting with _files*
). Anyway, this is just an idea if you are desperate, as it would have to be refined.
Potential solution future release
In a future release, I might make it so that all non-image file names word.doc
adobe.pdf
file.zip
could look for word_doc.jpg
adobe_pdf.jpg
file_zip.jpg
and use it as preview image instead of icon. This is a generic solution that would work for all file types. I would also need to make sure the JPG files are hidden somehow, unless we name them _files_word_doc.jpg
etc.
We could do it the other way round, and use an image that links to a ZIP file, but that seems more clumsy. Of course, if Files gallery ever gets basic CMS functionality, we could allow images to be linked to other files (eg zip
), but this is off topic for now.