Skip to content

Change Attachment interface to allow bytes instead of file path #368

@dantebarba

Description

@dantebarba

Would be great if the Attachment entity could be changed to allow bytes alongside file paths.

        # Create the Attachable object
        attachable = Attachable()
        attachable.FileName = "thumbnail.jpg"
        attachable.ContentType = "image/jpeg"  # Assuming JPEG format
        attachable._FilePath = temp_file_path  # Provide the temporary file path

        # Link the Attachable to the Item
        attachable.AttachableRef = [
            {
                "EntityRef": Ref(value=item_id, type="Item"),
                "IncludeOnSend": False,
            }
        ]

        # Save the attachment
        attachable.save(qb=qb_client)

Something like attachable._FileBytes would be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions