lua-users home
lua-l archive

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


Hi Michal,

On Mon, Mar 1, 2010 at 11:28 AM, Michal Kottman <k0mpjut0r@gmail.com> wrote:
You can set the Content-disposition header in order to force the browser
to download the file [1].

The header should look like this:

Content-disposition: attachment; filename=file.txt

In Orbit, this code should do the trick:

function send(web)
 web.headers['Content-disposition'] = 'attachment; filename=file.txt'
 web.headers['Content-type'] = 'text/plain'
 ...
end

Notice that you should also set the MIME type, otherwise the browser
thinks that you are sending a webpage.

[1] http://www.boutell.com/newfaq/creating/forcedownload.html


Tested and this works great! Thanks. 
--
Regards,
Ryan