Super, thanks.
This works but with 'write' rather than 'save'.

I am getting more and more impressed with web2py as I use it more.
JC

On Apr 2, 11:39 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> open(filename,'wb').save(response.render(view_filename,dict(a=3)))
>
> On Apr 2, 5:22 pm, JC11 <john.c...@gmail.com> wrote:
>
> > Sorry I did not make that clear.  The file should be saved on the
> > server.
> > JC
>
> > On Apr 2, 2:16 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Yes but I am not sure from your question if you want the visitor to
> > > save the file on the client machine or on the server machine. I assume
> > > the former:
>
> > > def save_file():
> > >      filename='bla.html'
> > >      response.headers['Content-Disposition']='attachment;
> > > filename="%s"' % filename
> > >      return dict(var='whatever')
>
> > > On Apr 2, 2:07 am, JC11 <john.c...@gmail.com> wrote:
>
> > > > Hello,
> > > > I would like to use the excellent template facilities in web2py views
> > > > {{....}} but save the results to a file rather than present them as a
> > > > web page.  How would this be possible ?
>
> > > > This is just for one of several views in my application and should
> > > > happen always for the one view without the user needing to do
> > > > anything.  This can manually be achieved by the user seeing the page,
>
> > > > > view source, > save as .....
>
> > > > Thanks,
> > > > JC
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to