On Feb 23, 2014, at 7:09 PM, Shaji Kalidasan <shajiin...@yahoo.com> wrote:
> Dear Perlers, > > I made some improvements in my code (now I am checking the file size of > remote file) but still can't figure out how to calculate the MD5 hash of a > remote file. You cannot calculate the MD5 digest of a file on a remote server. In order to calculate the MD5, you need access to all of the bytes of the file. To access all of the bytes, you need to download the file to your local computer. Since you are already downloading the file and calculating the MD5 of the local copy, it doesn’t do you any good to do it again. That will only confirm that the download succeeded (or you got exactly the same error twice.) You don’t need an MD5 calculation for that; you can just compare the two copies. You need to get someone with access to the server to compute the MD5 of the file on the server, then publish the MD5 value of the copy on the server. Then you can compare the MD5 of your local copy and verify that you have the same file as on the server. If you can’t arrange that, then some other approach is needed. You need to describe in more detail what you are trying to accomplish. The Digest::MD5::File module will calculate the MD5 digest of a URL, but it is just going to download the file before it does that. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/