This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have an application which can uplodad any type of files with whaever formats/extensions like .doc,.zip,.ppt,.pdf,.txt... I am storing this files in the db using blob and also I can able to retrieve the fiel from db to the local disk. I have written a servlet which can read the file from the local disk. But I don't know how to set the setContentType for different extensions. Whether I have to set the contentType differently for different file types or any other way to do it. For example: Below code is for word document to be read:
For .ppt / .txt / .pdf, whether I have to change the contentType or some any common contentType is available for use