Hi Team,
I'm trying to upload a file to a confluence using the following curl.
script {
response = sh(script: "curl -u 'xxxxx@xxxxxx:xxxxxxxxxx' -X POST -H 'X-Atlassian-Token: no-check' -F 'file=@${workspace}/1.txt' https://xxxxx.xxxxxx/wiki/rest/api/content/xxxxxx/child/attachment", returnStdout: true)
echo '=========================Response===================' + response
}
The file is placed in the Downloads directory on my laptop. I have changed the permission to 777, so accessing it shouldn't be a problem. However, the curl request seems to fail.
curl: (26) read function returned funny value
ERROR: script returned exit code 26
Dear @atalwar ,
have you tried, for debugging, to replace ${workspace} with a hard-coded path?
BtW: The endpoint
https://xxxxx.xxxxxx/wiki/rest/api/content/xxxxxx/child/attachment
doesn't look like to fit for cloud (you tagged the question as 'cloud'). It should be
https://<name>.atlassian.net/rest/api/content/{id}/child/attachment
So long
Thomas
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.