liquid_feedback_frontend
view app/main/index/document_file.lua @ 1821:7978d87b3552
Fixed wrong config variable
| author | bsw | 
|---|---|
| date | Wed Jan 26 01:44:32 2022 +0100 (2022-01-26) | 
| 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)
