ok, with dave's prompting and help, i got the code to work. i don't
understand why taking the response.write() function out there works. how
come?
here is my working snippet:
from cStringIO import StringIO
stream = StringIO()
if (file_return == 'xml'):
from gluon.serializers import xml
stream.write(xml(dct))
response.headers['Content-Type'] = 'text/xml;
charset=us-ascii'
response.headers['Content-disposition'] = 'attachment;
filename=hsDNA_%s_IQa.xml' % (qry[0][1])
return stream.getvalue()
else:
stream.write(r"%s" % dct)
response.headers['Content-Type'] = 'text/plain;
charset=us-ascii'
response.headers['Content-disposition'] = 'attachment;
filename=hsDNA_%s_IQa.py' % (qry[0][1])
return stream.getvalue()
i got rid of the csv option and just went with xml and python. both are
working great.
thanx dave, lucas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.