Anyone know of a way to obtain an MD5 checksum of a file (through HTTP) before downloading it through HTTP?

Recommended Answers

All 5 Replies

That seems kind of silly to me. The point of a checksum is to verify the legitimacy of a file after downloading it. If you're getting the checksum before downloading the file it's no different from taking on faith that the file is legit in the first place.

That seems kind of silly to me. The point of a checksum is to verify the legitimacy of a file after downloading it. If you're getting the checksum before downloading the file it's no different from taking on faith that the file is legit in the first place.

Regardless I'm looking for a way to get the checksum without downloading the file.

That seems kind of silly to me. The point of a checksum is to verify the legitimacy of a file after downloading it. If you're getting the checksum before downloading the file it's no different from taking on faith that the file is legit in the first place.

Would make sense to get the checksum to compare it with a file on the local computer to determine if they are identical. (IE if I have an identical file, no point wasting the bandwidth downloading it).

Anyone know of a way to obtain an MD5 checksum of a file (through HTTP) before downloading it through HTTP?

Only one way that I'm aware of: Request the file using a HEAD request instead of GET --the server should only return the HTTP headers for the file. One of the possible headers is Content-MD5 , which is a base64-encoded MD5 hash of the content. I say "possible" because it's entirely up to the server which headers it returns. If a server provides it, great; if not, you're out of luck.

commented: tyvm +9

PS: I agree with Skatamatic with regards to the data deduplication issue that he raised. I had the same thought today, and that is how I managed to find this post. I cannot find a clear study on data deduplication and the amount of traffic that is used globally to justify a more in-depth answer or argument. This is not something that is actively measured in general (to the best of my knowledge). Thus, I think there is a definate case for this. Yes, you want data flow and bandwidth usage to soar as a ISP, however this does not nessesarily mean that its ethical, or best business practice. Businesses, especially startups can save large amounts of money on traffic costs, when per MB cost applies.

Maybe worth checking this out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.