liquid_feedback_frontend
view app/main/index/document_file.lua @ 1710:62b8c3e17112
Added translation file with city instead of unit
| author | bsw | 
|---|---|
| date | Mon Sep 27 12:06:15 2021 +0200 (2021-09-27) | 
| parents | ad6048ec3432 | 
| children | 
 line source
     1 if not config.document_dir then
     2   return execute.view { module = "index", view = "404" }
     3 end
     5 local filename = param.get("filename")
     7 local file = io.open(encode.file_path(config.document_dir, filename))
     9 if not file then
    10   return execute.view { module = "index", view = "404" }
    11 end
    13 if param.get("inline") then
    14   request.add_header("Content-disposition", "inline; filename=" .. filename)
    15 else
    16   request.add_header("Content-disposition", "attachment; filename=" .. filename)
    17 end
    19 local data = file:read("*a")
    21 slot.set_layout(nil, content_type)
    22 slot.put_into("data", data)
