Skip to content

Trying to use get_attachment_content in RESTful API #330

@jeffpohlmeyer

Description

@jeffpohlmeyer

I have a site for which I'm building a customer comment/feedback section that I am hooking into DevOps to almost use as a SaaS so that we don't have to manually add bugs to DevOps. I've built functionality where a user can upload a file, but I want to build functionality to allow the user to again view the file that s/he uploaded. When I try to invoke get_attachment_content for a given ID I get a type <generator object RequestsClientResponse.stream_download at ...> How am I able to grab the content from said generator in order to convert it to a file to send for download? Even if I'm able to get the binary data from the generator it would be helpful because I can then convert the binary myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions