liquid_feedback_frontend

diff app/main/index/document_file.lua @ 401:08ba83dd47c0

Add support for files only available to logged in members
author bsw
date Wed Mar 07 19:07:20 2012 +0100 (2012-03-07)
parents
children a42bc1f0ed45
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/index/document_file.lua	Wed Mar 07 19:07:20 2012 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +if not config.document_dir then
     1.5 +  error("feature not enabled")
     1.6 +end
     1.7 +
     1.8 +local filename = param.get("filename")
     1.9 +
    1.10 +local file = assert(io.open(encode.file_path(config.document_dir, filename)), "file not found")
    1.11 +
    1.12 +print('Content-type: application/octet-stream')
    1.13 +print('Content-disposition: attachment; filename=' .. filename)
    1.14 +print('')
    1.15 +
    1.16 +io.stdout:write(file:read("*a"))
    1.17 +
    1.18 +exit()

Impressum / About Us