I don't have pyjamas experience doing this, but I have added similar
functionality to other sites with a web2py backend.
For the other sites, I create a link to a function that returns the file.
In that function, on the server, set content disposition to attachment. I
believe this tells the browser to download the file instead of navigating
away from the page. The line of code I used in a web2py backend was this:
headers['Content-Disposition'] = "attachment; filename=%s" % filename
I would guess if you can create a link, or open a url, to the file, or a
function that serves the file, you can have the download dialog popup.
On Mon, Feb 20, 2012 at 9:20 PM, Stephen Waterbury
<[email protected]>wrote:
> I'm probably being obtuse but can't see the easy way to do this:
> in my app's menu bar, I'd like to have one of the menu items to
> have an action that gets a binary file from a url. An iframe works
> great if the content is html, but the thing I need it to get
> is (ugh!) an ms word document (hateful, I know -- tell me about it!),
> so I'd like to make the menu item behave as if it were just a
> link so that it pops up a dialog so the user can save the doc
> somewhere -- any easy way to do that?
>
> Thanks!
> Steve
>