Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Neill Joubert
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!
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 Champion
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
Product Admin
TAGS
AUG Leaders

Atlassian Community Events