# Downloading multiple attachments

**URL:** <https://discuss.tryton.org/t/downloading-multiple-attachments/8294>\
**Category:** Developer\
**Created:** [February 10, 2025, 10:01am UTC](https://discuss.tryton.org/t/downloading-multiple-attachments/8294 "2025-02-10T10:01:04Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Xavi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xavi](https://discuss.tryton.org/u/Xavi)\
**Post date:** [February 12, 2025, 9:00am UTC](https://discuss.tryton.org/t/downloading-multiple-attachments/8294/7 "2025-02-12T09:00:38Z")

</div>

Thank you both for your quick responses.

> [@pokoli](#):
>
> From there its just a mather of reading the data from the `ir.attachment` model. You need to get the attachments related to your selected records. Something like:
> 
> `attachments = Attachment.search([('resource', 'in', [str(r) for r in self.records])]`
> 
> Once you get the attachment you just need to build the zip file using the standard [zipfile](https://docs.python.org/3/library/zipfile.html#module-zipfile) method

Yes, I already got there, but I still have the technical question on how to return the zip to the user (as it was a report).

> [@pokoli](#):
>
> If you want to share your development with others (I personally think this is usefull), you can ask for a repository under [tryton-community incubator](https://foss.heptapod.net/tryton-community/incubator). I will do the effort to review the code and improve it so we can promote as oficial tryton-community module.

I think the same as you, thanks for the proposal.

> [@pokoli](#):
>
> you can ask for a repository under [tryton-community incubator](https://foss.heptapod.net/tryton-community/incubator)

By the way how do I do this?

---

_[View the full topic](https://discuss.tryton.org/t/downloading-multiple-attachments/8294)._
