We've been using Confluence API to upload images in a specific section of our wiki pages, however these pictures are now not displaying correctly inside the macro (a page properties one, with a specific ID).
The API request goes through and succeeds; however in the attachments section we cannot see the preview of such images, we can only download them. The downloaded pictures correspond perfectly with what we expect to see in the page.
However, they seem not be loaded correctly in the page:
If we try to upload the same picture "manually" inside the macro and publish the page, it all works fine. Whenever we try to update it however, it will go back to the "failed to load mode".
Other pictures that we uploaded manually once can be previewed just fine.
Some specifications of the POST API call we perform:
```
headers = {"X-Atlassian-Token": "no-check"}
"minorEdit": True,
"type": "attachment"
"comment": timestamp
"url": https://xxx.atlassian.net/wiki/rest/api/content/<pageID>/child/attachment/<attachmentID>/data
"file": @file
```
We believe the problem is the `mediaType` the API recognizes the PNG file to be, which is oddly: `application/octet-stream`, as we see when we issue a GET call to get the list of attachments. However `mediaTypeDescription` is correctly `PNG Image`.
We couldn't find any way to force `mediaTyppe` to be `image/PNG` in the API documentation.
Any help would be appreciated, thanks.
Hello there @Alvise Z_ !
Going straight to the point, I tried to replicate the behavior but was unable to.
Even though our community is filled with capable members, I firmly believe that your situation will be best served by our sister, the Developer Community!
Maybe take a look and share your situation with our experts over there:
Let us hear from you!
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.