How to get file extention from Content-type.



Hi there,

I want to get file extention from file's content-type.
I wanted to handle file with blank name in my mail client.
For handling this I need to create temporary file. For that I need to
decide file extention based on content-type.

getFileNameMap(..) function of UrlConnection constructs FileNameMap but
FileNameMap has method just to fetch content type from file extetion. I
want exactly opposite of this i.e File extention from Content-Type.

It would be great if any one can help me.

Thanks,
Shilpa

.