[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Kepler] Using Orbit to start a download
- From: Ryan Pusztai <rpusztai@...>
- Date: Mon, 1 Mar 2010 11:47:19 -0500
On Mon, Mar 1, 2010 at 11:28 AM, Michal Kottman <firstname.lastname@example.org>
You can set the Content-disposition header in order to force the browser
to download the file .
The header should look like this:
Content-disposition: attachment; filename=file.txt
In Orbit, this code should do the trick:
web.headers['Content-disposition'] = 'attachment; filename=file.txt'
web.headers['Content-type'] = 'text/plain'
Notice that you should also set the MIME type, otherwise the browser
thinks that you are sending a webpage.
Tested and this works great! Thanks.