On 14/01/2010 19:49, kenk...@yahoo.com wrote:
Dum question, but how do you dump a binary file down to the web browser using
cgilua?
I found a decent upload handler example, but no download example...
Setting the appropiate headers. For instance (this code is not cgilua,
but you'll get the idea)
web.headers["Content-Type"] = "application/pdf"
web.headers["Content-disposition"] = "attachment;
filename=a_nice_filename.pdf"
local f = io.open (file_name, "rb")
local content = f:read("*a")
f:close()
web.headers["Content-Length"] = #content
and something like cgilua.put(content)
Hope that helps.
_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/