Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to attach file into page using Confluence API?

Sreylin Doung October 1, 2012

Dear all,

I want to attach any kind of file into page in a specific space in confluence from my plugin. So is there any way or API to do this?

Thanks,

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Nikola ILO
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

Probably the most easy way to use confluence API is through Bob Swifts Atlassian/Confluence CLI.

You can use the addAttachment command to add an attachment

You can access the tools here:

https://bobswift.atlassian.net/wiki/display/ACLI/Atlassian+Command+Line+Interface

The plugin changed to be commercial recently, but you can download the latest free release here:

https://bobswift.atlassian.net/wiki/download/attachments/16285777/crucible-cli-2.6.0-distribution.zip

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

Sreylin, given that you are just new at this, working with Nikola's answer is probably a good idea. When you're ready, you can write your own remote client application!

Sreylin Doung October 1, 2012

Hi Nicola & Matthew,

Thank for the suggestion of both of you. But my problem is that my plugin has to allow users to attach file into confluence page directly without adding attachment to page or using other tools. At first in my opinion, I want to create a plugin module that allow users to attach file because I think that Confluence API may allow me to do this. This is my purpose. But, now I don't know how to do it or where I should start. Hope you can show me how to do it.

Thanks,

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

You want to add an attachment INTO a page but NOT attach it to the page? I think that makes no sense. Where are you storing the attachment? What are you trying to do? What is so wrong with adding an attachment to the page?

Sreylin Doung October 1, 2012

oh..May be I use the wrong word. I mean that I want to add attachment to page (sure I have to attach it to the page). Usaully, when adding attachment, I go to the page and add attachment. I think this is the manual way of attaching file into page. But for my plugin, I want to use code(any confluence api) instead of doing this by just providing "pageId" .......

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

Ok, then who or what is adding the attachment? A user or automated software system? Can you give us an example? where is the attachment coming from?

Sreylin Doung October 2, 2012

let me tell you about my work. My plugin can allow users to record video or voice. After recording, the recorded video/voice has be to uploaded/attached to a specific page automatically. The attachment can come from local or Confluence Server ( because we have not decided yet where to store recoded file after recording).

1 vote
Danqing Liu July 30, 2013

Hi, I'm facing the same issue now...Have you figured out how to do that?

J D
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2014

Hi, any solution found?

1 vote
MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012

The technical documentation is here but I suspect that it may be a little too in-depth initially.

https://developer.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs#ConfluenceXML-RPCandSOAPAPIs-Attachments

Are you starting from scratch or do you have a working remote client already?

MatthewC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 1, 2012
Sreylin Doung October 1, 2012

Hi Matthew,

I am very new. I am just starting from the scratch. I have read through the document that you pointed, but I find it hard to understand. I hope you can give me advice on how to do it.

Thanks,

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events