view-file preview not updating after page updated via REST

I have updated a larger number of Confluence pages to use the view-file macro to show a PDF attachment. This was done via REST as it was basically a find-and-replace through many pages.

The updated pages show the placehoder for the view-file, but no actual preview - more a generic symbol/image. 

Is this a known issue caused by the update via REST? Can Confluence be triggered to generate the previews without going through each page?

2 answers

0 vote
Ann Worley Atlassian Team Aug 15, 2017

Please let me know more:

  • The REST syntax you used to update the pages.
  • Were the pages previewing a different PDF before or did you attach the PDF with REST?
  • Are all the pages displaying the same PDF?
  • Please attach a screen shot of the placeholder.

Please verify that you are using the view-file macro and not the older viewpdf macro. The new File Preview macro is called view-file in the storage format, which can be confusing, as you can see from: How to replace old View File macros with the new File Preview macro

I was not able to find a known issue for the REST update causing an issue with previewing files, though I did find this bug: viewfile not able to view pdf document. I am hopeful that the bug is not relevant to this case. If you manually add the same PDF to a test page, can you preview it then?

I used REST to iterate a larger set of similar pages to update/harmonize these. Specifically, the update transitioned to the new view-file macro. 

Only the storage format was updated. The pages already had the files attached.

The REST request was basically a PUT on .../content/{pageid} with body

{ id = 2424927, type = "page", title = "...", version = {{ number = 3, message = macro content migration }}, body = {{ storage = { value = ... , representation = storage } }} }

so this should be nothing unusual.

However, looking at the page shows this:

confluence-preview-issue.png

However, some actions may suddenly trigger the preview thumbnail to render, for example, click edit page (do not actually change anything) +preview + cancel.

The issue is true for all pages involving many different pdfs (and actually also some jpegs). 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

867 views 23 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you