Download files from url of site directory

Two zip files and Two images are in https://example.com/directory. (Since index.php file is available in this directory we don’t know the file names of those files).

Is there any possible way to find names of above four files using PHP or Linux commands?

Answer

You must keep in mind: if your web-server disallows to scan a directory then you couldn’t get file names. But if the directory is shared in web-server you can get a list of files with using wget command. For example:

wget -nv -r -np '*.*' https://example.com/directory/