Commit 485628268792cc140fb7c341da1b135cbc180b6e

Thomas de Grivel 2024-09-20T22:03:15

system("file", "-b", path)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/httpd/fx/app/views/fx_view.kc3 b/httpd/fx/app/views/fx_view.kc3
index 0b28d2b..f93cfcd 100644
--- a/httpd/fx/app/views/fx_view.kc3
+++ b/httpd/fx/app/views/fx_view.kc3
@@ -43,7 +43,8 @@ defmodule FXView do
         end
         """<pre class="#{size}">#{HTML.escape(file)}</pre>"""
       else
-        HTML.escape(mime)
+        desc = system(["file", "-b", path])
+        HTML.escape(desc)
       end
     end
     """<div class="#{size}">#{preview}<hr /></div>"""