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 votes
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:


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
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,164 views 2 13
Read article

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