After some research, I found the issue is not with the charset getting appended to the content type.
As the warning message states, the browser couldn't recognize the extension. So based on the file extension, I dynamically appended the extension.
Example:
.do for all types of files like jpg, pdg, doc, docx, txt, html
replace the .do with .xls(or).xlsx based on the file extension of the attached file. In this way browser does not throw the warning message and opens the xl file.
Put the .xls and .xlsx mappings in web.xml for action class.