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.

I want to download all the *.gif files from a particular location. For example, say the location is http://asdf.com/file/images/*.gif. When I use:

wget -m http://asdf.com/file/images/

I get a 403 (permission denied) error. But when I use:

wget -m http://asdf.com/file/images/xyz.gif

It works perfectly. There are about 50 images; how can I download them? I can't write 50 wget commands

share|improve this question

migrated from stackoverflow.com Jun 28 '10 at 18:28

This question came from our site for professional and enthusiast programmers.

1  
Do you know the filenames? –  SLaks Jun 28 '10 at 18:25
2  
Don't repost your questions. This is the same as Image folder download using wget. –  Matthew Flaschen Jun 28 '10 at 18:27
    
If you know the filenames this is trivial, especially if they are sequential (image001, image002, etc...) –  John T Jun 28 '10 at 18:33
    
@Matthew I think the problem here is this fellow posted the same question on stackoverflow.com and superuser.com. Naturally, someone at stackoverflow migrated the question here and it was duplicated. –  ghoppe Jun 28 '10 at 19:21
add comment

3 Answers

This is not possible.

wget cannot know which files exist on the remote server.

Instead, if the server has directory browsing enabled, or if the images are linked somewhere, you can crawl some other page.

share|improve this answer
add comment

I don't know why no one has suggested wget -r. OP is hitting a server that has directory listing disabled, but anyone passing through here should know that wget can handle recursive fetching easily. It can even filter by file types.

share|improve this answer
    
Points to you for answering my question. I was indeed passing through and had forgotten about that flag, thanks! –  cincodenada Jan 5 '13 at 1:05
    
One warning that I just learned: unless you want to traverse up to parent directories and download the whole damn website, add the -np or --no-parent flag, so that wget only descends downwards in the tree. –  cincodenada Jan 5 '13 at 3:17
add comment

You first example is trying to get a directory listing. The server has directory listing disabled and returning a 403.

share|improve this answer
add comment

Your Answer

 
discard

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