[Product-Developers] Generating file downloads on the fly

Andreas Jung lists at zopyx.com
Fri May 15 08:51:10 UTC 2009


On Fri, May 15, 2009 at 10:45, Rowan Woodhouse <
rwoodhouse at wirelessmeasurement.com> wrote:

>
> Hi,
>
> I need to generate a download file on the fly (it's an excel spread sheet
> with content drawn from a database) but I'm having some difficulty working
> out the best way to do this.
>
> At the moment I've got an Archetype based product that has a FileField in
> the schema. So far I've been attempting to work out a way to create the
> correct sort of accessor so that the generated file is never saved in Zope
> itself (at the moment I just get the file coming over as plain text mime
> type). Is this the best approach? If so could someone point me in the
> correct direction on how to wrap the file correctly so that it downloads
> correctly instead of coming over as a plain text file? If not could someone
> point me in a more sensible direction?


Generating Excel files has been discussed lately (check the list archive).
Sending out a generated content is trivial. You have to set correct
content-type|length HTTP header and emit the payload in the response
of the body (also explained a dozen times, check the archive).

-aj



>
>
> Regards,
> Rowan
> --
> View this message in context:
> http://n2.nabble.com/Generating-file-downloads-on-the-fly-tp2906670p2906670.html
> Sent from the Product Developers mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers at lists.plone.org
> http://lists.plone.org/mailman/listinfo/product-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090515/b4d7e003/attachment.html>


More information about the Product-Developers mailing list