module Roda::RodaPlugins::SinatraHelpers::ResponseMethods
def attachment(filename = nil, disposition=ATTACHMENT)
Set the Content-Disposition to "attachment" with the specified filename,
def attachment(filename = nil, disposition=ATTACHMENT) if filename params = "; filename=#{File.basename(filename).inspect}" unless @headers[CONTENT_TYPE] ext = File.extname(filename) unless ext.empty? content_type(ext) end end end @headers[CONTENT_DISPOSITION] = "#{disposition}#{params}" end