liquid_feedback_frontend
view 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 source
1 if not config.document_dir then
2 error("feature not enabled")
3 end
5 local filename = param.get("filename")
7 local file = assert(io.open(encode.file_path(config.document_dir, filename)), "file not found")
9 print('Content-type: application/octet-stream')
10 print('Content-disposition: attachment; filename=' .. filename)
11 print('')
13 io.stdout:write(file:read("*a"))
15 exit()