I am recieving a 500 "File name cannot be null or empty" error on the CreateAttachment API

Neill Joubert September 24, 2020

I am trying to upload some attachments to a confluence wiki page through the create attachment API.

 

I am using this curl as a test but keep getting an error after following all examples I can find on it:

curl -D- -u [username]:[token] -X POST -H "X-Atlassian-Token: nocheck" -F "file=MyFile.txt" -F "comment=This is my File" --header "Accept: application/json" https://[domain].atlassian.net/wiki/rest/api/content/[page_id]/child/attachment

 

The exact error I get back is: {"statusCode":500,"message":"java.lang.IllegalArgumentException: File name cannot be null or empty."}

 

Any other fields I might be missing in the request? I don't see anything else in the documentation on this.

1 answer

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 24, 2021

Hi Neill,

Looks like this isuse has been resolved in the new versin of confluence cloud: https://jira.atlassian.com/browse/CONFCLOUD-31088

Regards

Suggest an answer

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

Atlassian Community Events