Forums

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

Automating file upload to a page from a network drive

Дмитрий Пересекин
Contributor
July 20, 2020

Is it possible to somehow automate the upload of a file to the Confluence page?
Now the process is as follows: The page moderator enters edit mode, removes the old file from the page and adds a new one, then saves the page.
Is there a tool (possibly a separate development, e.g. SIL Script) to automate this process?

1 answer

0 votes
Dar Kronenblum
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.
July 20, 2020

you can use script runner, I'm guessing something like that will work:

 def filePath ="file path"
File file = new File(filePath)
if (file.exists()){
InputStream targetStream = new FileInputStream(file);
Attachment att = new Attachment(imgName,"png", file.length(), "UML image");
att.setContent(page)
attachmentManager. saveAttachment(att,null, targetStream)
}
Дмитрий Пересекин
Contributor
July 21, 2020

Thanks for the answer, we will try.
Friends, if you have any more ideas, please write. Thank!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events