Hi
here is bashscript that upload file to confluence, first time it upload correctly second time return error because of file with same name exist. is there any way like we upload file with same name through the web UI and it will add new version of file, do the same thing with curl command?
Here is my bashscript:
curl -u $USER_NAME:$API_TOKEN \
-X POST \
-H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" \
${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment
here is the error:
{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"Cannot add a new attachment with same file name as an existing attachment: result.csv","reason":"Bad Request"}
Any idea?
Thanks