taken from the book.... As noted above, response.download should be used to retrieve files stored via an upload field. response.stream can be used in other cases, such as returning a temporary file or StringIO object created by the controller. If attachment is True, the Content-Disposition header will be set to "attachment", and if filename is also provided, it will be added to the Content-Disposition header as well (but only when attachment is True). If not already included in response.headers, the following response headers will be set automatically: Content-Type, Content-Length, Cache-Control, Pragma, and Last-Modified (the latter three are set to allow browser caching of the file). To override any of these automatic header settings, simply set them in response.headers before calling response.stream.
So, you can use a StringIO instance to stream.... it **should** work with your blob contents. On Monday, November 18, 2013 2:03:45 PM UTC+1, Fred Guedes Pereira wrote: > > Thanks, Niphlod. > > Now it's clear for me, but I cant use response.stream() because it > receives a filename, not a content, as parameter. Should I save the content > into a local file first? > > Fred > > Em quinta-feira, 14 de novembro de 2013 14h21min37s UTC-3, Fred Guedes > Pereira escreveu: >> >> Hello, >> >> Is there a way to return PDF content generated from a blob db field? >> >> My table has a blob field whose content is PDF. I would like to create a >> 'PDF page' from those bytes and return it. >> >> Thanks, >> >> Sorry for possible duplication. >> >> Fred >> > -- 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/groups/opt_out.

