954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

MD5 from HTTP without download?

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

pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111
 

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.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
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.

pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111
 
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).

skatamatic
Posting Shark
959 posts since Nov 2007
Reputation Points: 403
Solved Threads: 129
 
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.

gusano79
Posting Pro
521 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You