File-type-aware preview
Currently, we only provide a text file preview. Or we are more or less using this for all files. We should provide something that is a bit smarter based on actual file types.
There are two principle sources for the file type. The file name, typically its extension and the file contents. The first one comes down to a dict lookup. The latter can be realized with magic on the server side. The second option is obviously much more expensive. Looking for the file name can be applied on lots of files, directly in the UI. Magic can probably only be done during processing or on request and on indidual files.
We do apply magic during processing anyways, but since there is no database entries on files, we cannot really store this information. Maybe, we can use extra file attributes (e.g. os.setxattr, ZipFile also seems to support in principle). But we would need to investigate first and support might be limited based on the fs and zipfile implementation.
We could have a file preview component that shows image files based on file name directly and offers more options (e.g. text-file preview) on demand.
-
text files -
image files