Skip to content

Getting attachments and uploading them to a different page #56

@dostjh

Description

@dostjh

We have a use case where we want to download content from a variety of spaces and re-upload them as copied pages to a centralized space. The one issue I'm having thus far is copying attachments.

var sourceAttachments = _client.Attachment.GetAttachmentsAsync(sourcePage.Id).Result; foreach (var attachment in sourceAttachments) { _client.Attachment.AttachAsync(targetPage.Id, attachment, attachment.Title, contentType:attachment.Metadata.MediaType); }

When I've uploaded attachments fresh, I've been able to create a bitmap and then upload that as a stream. However, I'm not seeing where the stream is for the attachments I'm getting from the source space.

I may be able to work around this by Downloading and then reuploading the attachment, but naively I'd expect GetAttachmentsAsync and AttachAsync to be able to work in tandem without recreating the file data wholecloth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions