Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • 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

ganesh ch March 7, 2016
 

2 answers

0 votes
ganesh ch March 7, 2016

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..

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.
March 7, 2016

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

 

ganesh ch March 7, 2016

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

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.
March 8, 2016

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.

0 votes
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.
March 7, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events