I have created a simple view which has a method to stream a file on the filesystem; basically the method does the following stuff:

self.request.response.setHeader('Content-Type', 'application/pdf')
self.request.response.setHeader('Content-Disposition', 'attachment;filename=%s' % download_filename)
self.request.response.write(buffer)

I can test the headers with browser.headers, but I haven't be able to test the response, which is always set to an empty string.

>>> browser.headers['Content-Type'] == 'application/pdf'
True
>>> browser.headers['Content-Disposition'] == 'attachment;filename=1.05.000.01_02_2_0B.pdf'
True
>>> browser.contents == ''
True
>>> browser.mech_browser.response().read() == ''
True

Is this a limitation of Five testbrowser? I'm using Five 1.4.2 on Plone 2.5.3.

Best,
Fabio Corneti
[EMAIL PROTECTED]

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to