Search code examples
.htaccesshttprequestwgethttp-status-code-403httpforbiddenhandler

Wget gives Error 403: forbidden


http://filedownloads.co.in/downloads/domain/October
In the above given web directory there are approx 30 zip file like

http://filedownloads.co.in/downloads/domain/October/2017-10-09hhwerahhqw_country-specific-database.zip
or
http://filedownloads.co.in/downloads/domain/October/2017-10-20weroiunewd_country-specific-database.zip

I want to download all file of that directory. I have tried all options available on stack-overflow related to my questions but every time i get the same Error 403: forbidden.
I have tried the following commands :
wget --user-agent="Mozilla" -r -np -A.zip http://filedownloads.co.in/downloads/domain/October
and
wget -r -l1 -H -t1 -nd -N -np -A.zip -erobots=off http://filedownloads.co.in/downloads/domain/October/
and
wget -U firefox -r -np http://filedownloads.co.in/downloads/domain/October/


Solution

  • I've tried to visit your link using browser and received the same "Forbidden" message.

    Try to open the link in Private window and see what happens. It's quite possible that you are logged in on this site, so your browser has cookies which allow you to view this directory. If so, you will need to find out these cookies and specify them too in wget so it can access the protected resource.