Set content-type based on filename extension

We're using text/plain for everything, which is OK for plain text but not
necessarily for some other types. Look at the filename extension and use
something that will probably work well, with application/octet-stream as a
fallback.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>