PHP Get the md5 remote file?

Can I get the md5 file on a remote server? If so, how?

+3
source share
3 answers

what about md5_file("http://remotelocation/file")

+14
source

This is not possible without downloading it or a remote server providing information (web service, HTML page, etc.).

You can use md5(file_get_contents("http://remotelocation/file")) to download the file and calculate the md5 hash if your PHP installation is configured to open remote threads. But this will download the full file.

+7
source

Good thing you mean. There are two ways:

  • You connect to the remote server and calculate the hash there (for example, ssh on the server).

  • Get (upload) the file and calculate the hash.

Obviously, in order to calculate the hash of a file, you must read the contents of the file.

+3
source

Source: https://habr.com/ru/post/1346969/


All Articles