• 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

This widget could not be displayed.

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

This widget could not be displayed.

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 Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

288 views 2 4
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