Command used :
curl -v -S -U user:Password -X POST -H "X-Atlassian-Token: no-check" -F "file=@image2020-11.png" -F "comment=this is my file" "https://confluenceURL/rest/api/content/199999999/child/attachment"
Error message received :
{"statusCode":403,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"User not permitted to create attachments for content: ContentId{id=199999999}","reason":"Forbidden"}* schannel: server closed the connection
I can upload the image when I login with the same ID in confluence UI.