Tuesday, December 16, 2014

How to download specific folder using wget

If you need to download the complete folder from a http server using wget, you may try wget -r option  to recursively copy the contents of the folder you specified. For a secure https protocol use flags --http-user and --http-password to specify username and password.

wget -r --http-user=username --http-password=password https://server.address/folder1/folder2

In this example, folder2 within folder1 on the https server is being transferred.

However, this may result in data from the parent folder/folders being copied also. To prevent this behavior use flag --no-parent to stop parent folders from being accessed.

wget -r --http-user=username --http-password=password --no-parent https://server.address/folder1/folder2/

No comments:

Post a Comment