[Zope] Download filtering

Peter Bengtsson mail@peterbe.com
Tue, 04 Jun 2002 00:19:03 +0100


--=======47CA905=======
Content-Type: text/plain; x-avg-checked=avg-ok-46FF43DB; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit


>
>return container.downloadFile()
>
>complained about the call.  Removing the () seems to work better, but it 
>is still far from clear to me how I

That would just return a method pointer/reference.


>- Obtain the content of a specific id in a given container;
>- Modify that content;
>- Return that content;

suppose you have a File object with id "myfile.txt"
Then::

data = getattr(container, "myfile.txt").data

if day=="tuesday":
     data = "%s\nToday is tuesday"

RESPONSE.setHeader('Content-type','application/data')
RESPONSE.setHeader('Content-Disposition','inline;filename=myfile.txt' )

return data


Hope that helps!

Peter


>Any clues gratefully accepted.
>
>TIA,
>
>- rmgw
>
><http://www.trustedmedianetworks.com/>
>
>----------------------------------------------------------------------------
>Richard Wesley                                  Trusted Media Networks, Inc.
>
>"Does anybody really know what time it is?  Does anybody really care?"
>       - Chicago
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
>http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.361 / Virus Database: 199 - Release Date: 2002-05-07

--=======47CA905=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-46FF43DB
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release Date: 2002-05-07

--=======47CA905=======--