I was able to upload an attachment using API but it doesn't appear on the page

Gabriel F_ May 3, 2023

I've use the method POST confluence/rest/api/content/${PAGE_ID}/child/attachment, and it has worked fine, but when I browse into the page the file is not there.

 

 

curl -H "Authorization: Bearer ${TOKEN}" -H "X-Atlassian-Token: nocheck" -X POST -F "file=@${filename}" -F "minorEdit=true" -F "comment=Example attachment comment" ....confluence/rest/api/content/${PAGE_ID}/child/attachment
result:
% Total % Received % Xferd Average Speed Time Time Time Current
31 Dload Upload Total Spent Left Speed
32100 6741 0 0 100 6741 0 65472 --:--:-- --:--:-- --:--:-- 66088

1 answer

0 votes
Barbara Szczesniak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2023

@Gabriel F_ Are you looking for the file to be displayed on the page or just attached to it? If you go to the Attachments for the page, is it listed there? I don't think it will automatically appear on the page unless you have inserted a gallery macro or something to display all files attached to the page.

Gabriel F_ May 4, 2023

Thank you @Barbara Szczesniak for the information.

When I go to the Attachments for the page nothing is listed there.

It doesn't actually need to auto-display, but even navigating to the attachment page, nothing is shown :/

Gabriel F_ May 5, 2023

any other suggestion?

venkatesh vp August 28, 2024

@Barbara Szczesniak  I am looking for the file to be displayed on the page. I was able to attach the file but lso needs to display it. Thanks.

Barbara Szczesniak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2024

@venkatesh vp I don't know anything about how things work with the API; I just use Confluence through its UI. Sorry, but I don't think I can help on this.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events