0

I would like to download a file from the following link (direct download link) :

https://download.spaces.hightail.com/api/v1/download/sp-79272721-ef49-4de4-a239-01f5be0692a7?downloadFile=true&redirectOnError=%2Freceive%2FSxnIY0QbDr

In browser when I hit the above url, it gives me the following error : "Credentials are required to access this resource."

To overcome this, first I access the base url (given below) in the browser and then from another tab hit the direct link. This allow me to download the file without credential required error. https://spaces.hightail.com/receive/SxnIY0QbDr <--- Base url

I would like to download the same file with curl using direct download link. However I get the same 'credential required' error.

  1. How can I download the file using curl from direct download link and avoid "credential required" error ?
  2. Why do I need to access the base url first before accessing the download link in the browser ?

May be base url share some authentication information with the browser and the same is used by browser later, but I don't have clear understanding.

Thanks !!!

1

1 Answer 1

0

The way I solved this issue is :

  • Get the request headers details (raw data) from browser developer tool when downloading the file using browser and store them in a local file. It also contains cookie which is used for authentication.

  • Get the certificate (.pem) file. Since I am using some proxy server, I got it from the proxy server admin console.

  • Execute the following curl command :

    curl -v -S -x proxy_ip:proxy_port -H "$(cat raw_header)" --cacert cert.pem -o ./myfile https://download.spaces.hightail.com/api/v1/download/sp-79272721-ef49-4de4-a239-01f5be0692a7

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.