Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload multiple files (htmls,images,excel,pdfs) into confluence ?

Venu_Joguparti May 6, 2020

I have requirement to migrate and upload bulk of HTML's /PDF's/Excel sitting in one folder into Confluence, Is there a way or example or Java code to acheieve programatically ?

1 answer

0 votes
Ollie Guan
Community Champion
May 6, 2020

Hi @Venu_Joguparti ,

The following plugin may be helpful to you

Confluence Command Line Interface (CLI)

Add multiple attachments from a directory matching a regex pattern. Use minor to avoid notifications. Use recursive to find files in sub-directories.

Venu_Joguparti May 6, 2020

Thank you @Ollie Guan  for prompt response , I will take a look on to that I am very new to this , I have bunch of files in my hard disk and want to upload , any examples how can I use that interface 

Michael Kuhl {Appfire}
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.
May 7, 2020

Hi @Venu_Joguparti - Here's an example command with the Confluence CLI to upload files from a particular directory to a specific page in a space:

acli --action addAttachments --space "myspace" --title "my page" --file "./directory/containing/files/" --server "wiki.myserver.com" --user "myUserName" --password "myPassword"
Venu_Joguparti May 7, 2020

@Michael Kuhl {Appfire}  I tried with below command , looks like i am missing something

 

acli --action addAttachments --space "XXXX.atlassian.net" --title "my page" --file "./Downloads/comingsoon_12/comingsoon_12/" --server "wiki.myserver.com" --user "vXXXXX@gmail.com" --password "XXXXXXX"

 

I have html/css/pdf in local disk under downloads and trying to upload in confluence space which i created 

 

Can you correct if i missing something 

Venu_Joguparti May 7, 2020

@Michael Kuhl {Appfire}  it also  throws back as Space is unknown flag

Michael Kuhl {Appfire}
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.
May 7, 2020

Two things to make sure of with --space:

  1. Make sure --space is all lower case.
  2. Use the space key without quotes to be more precise (--space SPACEKEY).  It looks like you are providing your confluence URL for your space in your example above.

Also, I just noticed that your are using Confluence cloud so you need to make two other changes:

  1. --server will be the URL of your cloud Confluence. 
  2. Rather than --password you will need to use --token and provide your Atlassian cloud API token.
Venu_Joguparti May 7, 2020

@Michael Kuhl {Appfire}  thank you for the prompt response . I tried with the below command as per your input

 

acli --action addAttachments --space teamspace --title teampages --file ../XXXXXXX/Development/XXXX/News/DEV_C_Conference_2014/ --server XXXXX.atlassian.net --user vXXXXXX@gmail.com --token XXXXXXXXXXXNzXXXXXXX

 

Getting the below error when i run the above command

Error

Parameter error: Unknown flag 'space'. Action was addAttachments for the jiracloud client. Other related clients were also attempted without success.

Michael Kuhl {Appfire}
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.
May 8, 2020

It looks like the problem is with your server parameter.  Notice in the error it states: "Action was addAttachments for the jiracloud client".  It thinks you want to perform the action on Jira cloud but Jira doesn't have spaces.  I suspect the full url for your Confluence instance is xxxxx.atlassian.net/wiki.  With that URL it should use the Confluence Cloud client. 

To be extra sure you can also add confluencecloud after acli like so:

acli confluencecloud --action ....

 

Like Deleted user likes this
Deleted user May 11, 2020

.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events