liquid_feedback_frontend
annotate app/main/index/document_file.lua @ 1392:41e3da074385
Changed style of register image upload 2
| author | bsw | 
|---|---|
| date | Mon Aug 13 19:19:19 2018 +0200 (2018-08-13) | 
| parents | 32cc544d5a5b | 
| children | ad6048ec3432 | 
| rev | line source | 
|---|---|
| bsw@401 | 1 if not config.document_dir then | 
| bsw/jbe@1309 | 2 return execute.view { module = "index", view = "404" } | 
| bsw@401 | 3 end | 
| bsw@401 | 4 | 
| bsw@401 | 5 local filename = param.get("filename") | 
| bsw@401 | 6 | 
| bsw@401 | 7 local file = assert(io.open(encode.file_path(config.document_dir, filename)), "file not found") | 
| bsw@401 | 8 | 
| bsw@402 | 9 if param.get("inline") then | 
| bsw@402 | 10 print('Content-disposition: inline; filename=' .. filename) | 
| bsw@402 | 11 else | 
| bsw@402 | 12 print('Content-disposition: attachment; filename=' .. filename) | 
| bsw@402 | 13 end | 
| bsw@401 | 14 print('') | 
| bsw@401 | 15 | 
| bsw@401 | 16 io.stdout:write(file:read("*a")) | 
| bsw@401 | 17 | 
| bsw@401 | 18 exit() |