Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The following works because I inserted the exact filename:

wget --referer=http://www.*****.com --cookies=on --load-cookies=cookie.txt --keep-session-cookies --save-cookies=cookie.txt http://www.*****.com/doc/GG-15252252.html

But if I just do it with the doc dir I will get a 403 error message:

Connecting to www.*****.com|***.**.***.**|:**... connected.
HTTP request sent, awaiting response... 403 Forbidden
2010-11-04 21:25:38 ERROR 403: Forbidden.

So I can't list the dir, what can I do?

Please help anybody and thanks :)!!

share|improve this question
    
403 means you aren't permitted to access the file[s]. So it probably isn't possible. –  Wuffers Nov 4 '10 at 20:33
    
I am permitted. I got a user and password –  kaspr Nov 4 '10 at 20:38

1 Answer 1

You might need to specify the username and password as part of the wget command using the --http-user and --http-password options.

However, I think it's more likely that the webserver is configured to not generate index pages automatically, or deny access to them. This is a common way for webmasters to prevent people from getting a list of all files in a directory.

share|improve this answer
    
Hi ultrasawblade and thanks. I got this error when trying that: Connecting to www.*****.com|***.**.***.**|:80... connected. HTTP request sent, awaiting response... 405 Method Not Allowed 2010-11-05 10:49:09 ERROR 405: Method Not Allowed. –  kaspr Nov 5 '10 at 9:50
    
The site is a asp.net auth with this form code: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJOTY3MTE1MDA4ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAgUaY‌​3RsMDAkUkhlYWRlciRTZWFyY2hCdXR0b24FL2N0bDAwJHBoJGZzZWFyY2gkU2VhcmNoQ29yZUNvbnRyb2‌​wkU2VhcmNoQnV0dG9uaIzURx8rrbEKPD6K4mM4D8rzvpc=" /></form> –  kaspr Nov 5 '10 at 10:06
    
Ahh. Now this is making more sense. The options I mentioned above only apply if the browser itself (not through javascript) pops up a dialog asking for username/password. Anyway, 405 means the site wants a POST reply and not a GET, which is what you're sending it. wget is able to send POST replies which are the common way for a browser to respond with filled out form data. Read the wget man page to see how it works. –  ultrasawblade Nov 5 '10 at 11:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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