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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I automatically update images on a confluence page?

I use Excel to periodically generate a set of pivot charts from various relational databases. I am able to write a .png file to disk each time each chart is updated, and have control over the file names that are created.

How can I update a confluence page/dashboard so that the new images are loaded automatically (the latest images are always displayed)?

3 answers

1 accepted

2 votes
Answer accepted

You'll need to use the REST API to attach new versions of the files when updated, then use a simple "display image" macro to display "latest".  Your users will still need to refresh the page.

Thanks, I'll look in to this approach.

Ok, I have the images loading via REST, but I can't update them. My curl command line options are:
-o nul -w "%{http_code}" -u [username]:[pwd] -X POST -H "X-Atlassian-Token: nocheck" -F "file=@[path]" -F "minorEdit=true" -F "comment=Added by VBA macro through REST API."

I understand I need to handle the revisions, but I don't know how to do that.

I answered my own question:

curl -D- -k -u $user:$pwd -p -H "X-Atlassian-Token: nocheck" -X POST \
 -F file=@filename https://confluence.domain.tld/confluence/rest/api/content/$page_id/child/attachment/$attach_id/data

Hello @Jeff Abbott 

Sorry for asking, how do you write a .png file to disk each time each Excel chart is updated ?

Regards,

JLuis

Hi Jeff,

Thanks for your question and answer. Very helpful indeed. 

I use the same curl to update images on my Confluence pages. Ever since the new Confluence editor I get the error “Fail to load” on the images. Is there something different I need to do with my curl command? If I update the images manually I have no problems.

Thanks in advance!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...

1,542 views 7 29
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you