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)?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jeff Abbott
Sorry for asking, how do you write a .png file to disk each time each Excel chart is updated ?
Regards,
JLuis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.