Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Attachments

Oskar Dillén edited this page May 7, 2014 · 6 revisions
Example: Remove all attachments with the name "DevSupport" from a card 
var card = trello.Cards.WithId("a card id");
foreach (var attachment in card.Attachments.Where(a => a.Name == "DevSupport"))
    trello.Cards.RemoveAttachment(card, attachment);

There are two ways to upload an attachment, either using a file path:
```csharp
trello.Cards.AddAttachment(card, new FileAttachment(@"C:\temp\image.jpg", "An image"));

Or an array of bytes:

trello.Cards.AddAttachment(card, new BytesAttachment(
    File.ReadAllBytes(@"C:\temp\image.jpg"), "An image", "image.jpg"));
Clone this wiki locally