(home | about | stats)

pwyky: FindMimeFromData

Windows has a mechanism that can look at the contents of a buffer and determine the appropriate content-type. The Microsoft site has an article that talks about how this works.

You can use the FindMimeFromData call to figure out what content-type to set when sending content via HTTP. Two important things to note:

The following code reads 256 or fewer bytes from a file, passes the buffer to FindMimeFromData and translates the content-type into ANSI.

www.mobilitytech.com owner. This is a pwyky site.