This was a surprise for me because SharePoint 2007 (MOSS) has this feature. Microsoft SharePoint 2010 says that it has closed this option intentionally as there are security threats as there is a possibility that some unwanted code snippets are uploaded in the document.
To solve this problem
- Go to Central Administration
- Click Manage Web Applications
- Select the web application for which you want to change the default behavior
- Click General Settings from the top ribbon
- Scroll down to Browse File Handling
- Change the option from Strict to Permissive
- Click OK
Now go to document library of the site again and test the new behavior.