lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Fabio,

On Thu, Oct 8, 2009 at 10:41 AM, Fabio Mascarenhas <mascarenhas@acm.org> wrote:
Hi RJP,

You can use the serve_static method of your application object to send
a file to the client. It sets the content-type based on the extension
of the file you are sending. The syntax is

orbit_app:serve_static(web, path_to_file)

It returns the contents of the file, so just tail-call it in your
handler.

This is probably a stupid question, but what does it mean to tail-call it?
 
serve_static also supports X-SendFile, if you set
use_xsendfile to true in your application object.

What are the reasons to use X-SendFile versus the default?
--
Regards,
Ryan