Forums

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

Not able to upload the document int confluence page, getting error

Abhishek Rana October 4, 2021

Hi Team,

 

Not able to upload the documents to confluence page using shell script, getting below error

./test.sh

cat: target_page_id.txt: No such file or directory

1 answer

0 votes
Kishan Sharma
Community Champion
October 4, 2021

Welcome to the Atlassian Community @Abhishek Rana 

I think you have not mentioned absolute path of the "target_page_id.txt" file in your test.sh script or it is not yet created hence the not found error.

Abhishek Rana October 4, 2021

AB378389@C02FQ7ZZMD6M Desktop % pwd

/Users/AB378389/Desktop

AB378389@C02FQ7ZZMD6M Desktop % ./test.sh

Kishan Sharma
Community Champion
October 4, 2021

Can you cat the script or paste the lines where target_page_id.txt is mentioned ?

Abhishek Rana October 4, 2021

I tried in below way also. But no luck

 

/Users/AB378389/Desktop

AB378389@C02FQ7ZZMD6M Desktop % USER_NAME=abhishek.rana2@******.com

USER_PASSWORD=***********

CONFLUENCE_BASE_URL=https://abhishekrana17.atlassian.net/

ATTACHMENT_TYPE=image

ATTACHMENT_FILE_NAME=/Users/AB378389/Desktop/8sept.jpg

PAGE_ID=196757

 

curl -u $USER_NAME:$USER_PASSWORD \

-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 2>/dev/null \

| jq -r '.results[].title'

zsh: command not found: jq

AB378389@C02FQ7ZZMD6M Desktop %

 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2021

You haven't got jq installed and in the path in that set of commands, and it has nothing to do with the error you've asked about either.

Could you stick with one thing please?  Do you want to fix the problem you originally asked about, or debug the new thing with the jq error?

Like Kishan Sharma likes this

Suggest an answer

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

Atlassian Community Events