[IMP] web: better content-type for attachments

Add the corresponding content type document instead the default content type.
This allows browser to detect the type of file being downloaded.
Fixes #1225