curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: 403 Forbidden Error

From: Hans Henrik Bergan via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 17 May 2024 07:24:42 +0200

That website is using a referer-check to block direct access to images.
This works:
curl -H 'Referer: http://gfaarchive.info/'
'http://gfaarchive.info/gfa/gfacn32/20240517T0600_cldwx_012.png'
If you want to download the whole website, try wget mirror:
wget --no-check-certificate --referer='http://gfaarchive.info'
--mirror 'https://gfaarchive.info/gfaDisplay.php'



On Fri, 17 May 2024 at 01:34, Ralph M via curl-users
<curl-users_at_lists.haxx.se> wrote:
>
> On Thu, May 16, 2024 at 6:15 PM Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se> wrote:
>>
>> On Thu, 16 May 2024, Geoff Sindel via curl-users wrote:
>>
>> > You are getting a 403. That is, you are not allowed to access that resource.
>> >
>> > Are you supplying any value for Authorization in the headers?
>>
>> Missing or wrong authorization gives you a 401.
>>
>
> Going to that URL with a browser, I get this:
>
> 403
> Forbidden
> Access to this resource on the server is denied!
>
> There's probably a cookie and/or login information missing when just trying to pull the file. I had a similar problem once with a server that wanted me to collect a frames page first, followed by frame contents in a specific order, because each frame section returned a specific cookie. It wouldn't just let me collect the main frame, I had to get headers and sidebar first.
>
> OP will probably need to start at the main page and craft a script to drill down to the images in the same manner as doing it via a browser.
>
> Ralph Mitchell
>
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
> Etiquette: https://curl.se/mail/etiquette.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-05-17