Attachment file name and extension is not displaying on the confluence page body

Affan Rashid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 23, 2021

I am uploading a file using node.js and axios via APIs onto my confluence page and using the following endpoint:

PUT  https://<companyname>.atlassian.net/wiki/rest/api/content/<pageID>/child/attachment

The file uploads correctly under the "Attachments" section of the page with the file name and extension (DataDictionary.txt).

I am then trying to put the file onto the main page's body and instead of showing "DataDictionary.txt" I see a random number 1990001000.

dd.png

I am using the following endpoint:

PUT on https://<companyname>.atlassian.net/wiki/rest/api/content/<pageID>

with the payload:

confluence.png

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2021

Hello there!

That is an interesting behavior, @Affan Rashid. I was not able to replicate it, so I would like to ask you a few questions:

  1. Are you uploading a new version of the attachment?
  2. Are you able to set the file preview via user interface?
  3. Is this affecting one specific file type or multiple ones?

 

I was also able to find a report about a very similar case, but it only happens when the user tries to upload a new version of the attachment. You can check it here:

 

Let us hear from you!

Affan Rashid
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 27, 2021

Hi Diego,

1. I update the version number every time I do a PUT on the following endpoint.

PUT on https://<companyname>.atlassian.net/wiki/rest/api/content/<pageID>

 I increment the version number by 1 in my code on the following payload:

Greenshot 2021-04-27 12.08.47.png

2. I was able to manually upload the file using the "Files & Images" option on my page and the preview correctly shows the file as a .txt

Greenshot 2021-04-27 12.08.47.png

3. I have not tried with any other file types.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events