[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Kepler] Using Orbit to start a download
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Thu, 8 Oct 2009 11:41:58 -0300
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. serve_static also supports X-SendFile, if you set
use_xsendfile to true in your application object.
--
Fabio Mascarenhas, Lablua
http://www.lua.inf.puc-rio.br
On Thu, Oct 8, 2009 at 11:36 AM, RJP Computing <rjpcomputing@gmail.com> wrote:
> Since LuaForge is down I hope it is ok for me to ask Kepler and Orbit
> questions here.
>
> Hi,
>
> I am using Orbit in an application and I want to create a URL map to
> download files, like this "http://somesite.com/download/filename.zip". How
> do I make the browser think that it is time to download the file. I Googled
> and found a PHP article where it was using header(). How can I do this in
> Orbit. Thanks.
> --
> Regards,
> Ryan
>