liquid_feedback_frontend

diff app/main/index/document_file.lua @ 402:a42bc1f0ed45

Support to show documents inline instead of downloading
author bsw
date Wed Mar 07 19:30:52 2012 +0100 (2012-03-07)
parents 08ba83dd47c0
children 32cc544d5a5b
line diff
     1.1 --- a/app/main/index/document_file.lua	Wed Mar 07 19:07:20 2012 +0100
     1.2 +++ b/app/main/index/document_file.lua	Wed Mar 07 19:30:52 2012 +0100
     1.3 @@ -6,8 +6,11 @@
     1.4  
     1.5  local file = assert(io.open(encode.file_path(config.document_dir, filename)), "file not found")
     1.6  
     1.7 -print('Content-type: application/octet-stream')
     1.8 -print('Content-disposition: attachment; filename=' .. filename)
     1.9 +if param.get("inline") then
    1.10 +  print('Content-disposition: inline; filename=' .. filename)
    1.11 +else
    1.12 +  print('Content-disposition: attachment; filename=' .. filename)
    1.13 +end
    1.14  print('')
    1.15  
    1.16  io.stdout:write(file:read("*a"))

Impressum / About Us