• Community
  • Products
  • Confluence
  • Questions
  • I am trying to download the pdf ("http://confluence.rbm.ericsson.se/spaces/flyingpdf/pdfpageexport.action?pageId=2133472") using curl or wget by giving username and password but I am not able to download the pdf. Please suggest how to resolve this issue

I am trying to download the pdf ("http://confluence.rbm.ericsson.se/spaces/flyingpdf/pdfpageexport.action?pageId=2133472") using curl or wget by giving username and password but I am not able to download the pdf. Please suggest how to resolve this issue

 

2 answers

0 votes

That system is protected by a user name and password, you'll either need to provide them (encoded properly in the curl/wget call) or perform a two step process where you log in once, get a session token, and then provide that in the second "get pdf" call

Thanks for the quick response.

I tried by providing the username and password in curl and  it is giving the below response 

< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: frame-ancestors 'self'
< Location: http://confluence.rbm.ericsson.se/download/temp/pdfexport-20160307-0
70316-1305-583/EAD-TeamReporting-070316-1305-584.pdf?contentType=application/pdf

 

I tried above the location URL and it is throwing error...

If you have any example code, could you please post me..

That suggests that you are not giving it a username and password.  How are you specifying this in curl?

 

curl -v -u xxxxx:xxxxx -X GET -H "X-Atlassian-Token: no-check" http://confluence.rbm.ericsson.se/spaces/flyingpdf/pdfpageexport.action?pageId=2133472

It is providing the below response 

< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: frame-ancestors 'self'
< Location: http://confluence.rbm.ericsson.se/download/temp/pdfexport-20160308-080316-0546-592/EAD-TeamReporting-080316-0546-593.pdf?contentType=application/pdf

Based on the location URL, I have given the  curl command as below

curl -v -u xxxx:xxxx -X GET -H "X-Atlassian-Token: no-check" http://confluence.rbm.ericsson.se/download/temp/pdfexport-20160308-080316-0546-592/EAD-TeamReporting-080316-0546-593.pdf?contentType=application/pdf

 encoded response is printing on console and not able to download the PDF

Really sorry, misread that completely.

But I think I can see a problem - I think you're trying to fetch an object that the system is generating on the fly.  If you use a browser, the system is going "ah, ok, I need to build that from the data, give me a minute.... ok, here you are".  But curl and wget simply grab the object, which isn't there when the request lands.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,027 views 51 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you