http://www.hanselman.com/blog/TheContentDispositionSagaControllingTheSuggestedFileNameInTheBrowsersSaveAsDialog.aspx
in web2py-ese response.headers['Content-Dispotion']='filename=%s' % filename On Feb 4, 9:50 pm, INeedHelp <zhang.kil...@gmail.com> wrote: > I have this fucntion which will drop down list all owner name and a > submit button. after i click on e submit button, e screen will display > all dogs below to e selected owner (from dropdownlist) > > def index(): > > records=db(db.dog.owner==request.vars.owner)\ > .select(orderby=db.dog.title) > form=SQLFORM(db.entry,fields=['owner']) > > but now, i would like to add in this function (below) after click the > submit button, it will save "only" e selected owner and his all dogs. > and how can i set the name of the file to be saved according to the > owner name plus the datetime > > s=StringIO.StringIO() > records.export_to_csv_file(s) > response.headers['Content-Type']='text/csv' > return s.getvalue() > > thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---