Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dantebarba opened this issue Nov 19, 2024 · 0 comments
Open

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

dantebarba opened this issue Nov 19, 2024 · 0 comments

Comments

@dantebarba
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant