PHP scandir of an url

天大地大妈咪最大 提交于 2019-11-29 12:56:16

This is not possible. scandir() and many other file operations only work local.

If you want to get a list of files on a remote server then you need a script/API on the server that will return that file list.

Just imagine what would happen if you could read all files and directories on a remote machine? Security would be realy compromised.

alexander.polomodov

Scandir works perfectly for local directory.

scandir — List files and directories inside the specified path

But you can't get list of files onto server, because in many cases urls are not directly mapping on files (e.g., location command of nginx webserver). Also webservers usually block possibility of getting list files for directories (see this settings for apache)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!