-
-
Notifications
You must be signed in to change notification settings - Fork 4
DownloadAttachmentAsync
Rasmus Wulff Jensen edited this page Nov 2, 2024
·
1 revision
/// <summary>
/// Download an Attachment
/// </summary>
/// <param name="cardId">Id of the Card</param>
/// <param name="attachmentId">Id of Attachment</param>
/// <param name="cancellationToken">Cancellation Token</param>
/// <returns></returns>
public async Task<Stream> DownloadAttachmentAsync(string cardId, string attachmentId, CancellationToken cancellationToken = default) { ... }or
/// <summary>
/// Download an Attachment
/// </summary>
/// <param name="url">URL of the attachment</param>
/// <param name="cancellationToken">Cancellation Token</param>
/// <returns></returns>
public async Task<Stream> DownloadAttachmentAsync(string url, CancellationToken cancellationToken = default) { ... }//Download all Attachments on a Card
var cardId = "6725ecb5bd6ed225c2ec21aa";
var attachments = await client.GetAttachmentsOnCardAsync(cardId);
foreach (Attachment attachment in attachments)
{
Stream stream = await client.DownloadAttachmentAsync(cardId, attachment.Id);
await using var fileStream = File.Create("C:\\Temp\\" + attachment.FileName);
await stream.CopyToAsync(fileStream);
}If you are looking for info on a specific method in TrelloDotNet then expand the Pages above and input the 'MethodName' (Example: 'AddCardAsync')