I want to get all the images from a website behind our company firewall, similar to what was asked here. I can access the site from Firefox on OS-X, but when I try to use curl I get:

You are not authorized to view this page

You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.

Please try the following:

  • Contact the Web site administrator if you believe you should be able to view this directory or page.
  • Click the Refresh button to try again with different credentials.

HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.
Internet Information Services (IIS)

Technical Information (for support personnel)

  • Go to Microsoft Product Support Services and perform a title search for the words HTTP and 401.
  • Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled About Security, Authentication, and About Custom Error Messages.

Shouldn't this be able to work given that Firefox can do it? Firefox asks me for my user name and password, so I've tried giving that on the command line, e.g.:

curl http://site -o index.html --create-dirs -u me:mypass

Any suggestions?

  • Besides what was mentioned about auth mechanisms below, you can try logging into the site in Firefox, using an add-on to export all your cookies to a text file, then use curl --cookie <cookie file> and see if it works.
    – Karan
    Jun 18 '13 at 8:30

You could always try using the DownThemAll addon for firefox that was suggested in the question you linked to.

Curl is probably using a different authentication method than what the server wants. Look in the manual for curl for more authentication methods. You can try accessing the page in curl without credentials to get a hint on what it wants.

You should also try using https:// in curl in case that is something the server requires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.