You probably should not change the file extension, changing the headers is sufficient to have your file served as xml
On Apr 23, 10:28 am, Timmie <timmichel...@gmx-topmail.de> wrote: > > applications/yourapp/controllers/default.py > > > and add an action > > > def kml(): > > placemarks=db(...).select(....) ## fill the ... > > return dict(placemarks=placemarks) > > The action is already in there. > My question was aiming at how to indicate web2py to render the page as > xml (kml as subset up xml) and not as html. > > If I name the file > applications/yourapp/views/default/kml.html > it shows the placemark variables. > > But with the filename > applications/yourapp/views/default/kml.kml > it returns "invalid function". > > I hope that my explanation is a bit clearer. > > Do I need to add > > response.headers['Content-Type']='text/x-kml' > response.headers['Content-Disposition']='attachment; > > to my function in default.py ? > > Thanks in advance, > Timmie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---