-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to add attachment to page #50
Comments
Ok, I'll make something. Hang-in there, I don't always have time to work on this. |
I found this code on stack overflow using rest api that works but it would be nice to have a simple wrapper that offer more parameters maybe.
|
but attachment update doesn't work with that code. |
My underlying framework does most of the work for you!
That's all... (c# 9 syntax, if you can't use that you just need to do a using block around your stream) Btw. Somewhere when your application starts, you'd want to make sure that the underlying HttpExtensions works with Bitmaps, you need to call the following ONCE: BitmapHttpContentConverter.RegisterGlobally(); var attachments = await _client.Attachment.AttachAsync(toPageId, bitmap, "image.png", "Just attached a bitmap"); By default the image is stored as a PNG, you can configure this, but I think the first option if what you need. |
thanks a lot! |
@fredggy Does this mean that works for you? |
Hi, I am trying to add an image to an existing confluence page.
Can you share some code exemple to do so?
I'm looking into this functions but I am not sure what is the way to go.
thanks
`
// what should the content string be?
private async Task CreateAttachment(string title, string content, long parentId)
{
return await _client.Content.CreateAsync(ContentTypes.Attachment, title, SpaceId, content, parentId);
}
`
The text was updated successfully, but these errors were encountered: