Create a event receiver for ItemUpdating and attach to the document library and see the below code it will not update the document, if its already exists in the library then throws an error.
public override void ItemUpdating(SPItemEventProperties properties)
{
base.ItemUpdating(properties);
if (properties.ListItem.File.Exists)
{
properties.ErrorMessage = "File Allready exists uploaded by other user.";
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.Cancel = true;
}
OR
This is due to the security behind the "Browser File Handling" option in the General Settings of a Web Application. If you want all files to open in their respective program (as they did in SharePoint 2007):
Go to Central Administration -> Application Management -> Manage Web Applications
Highlight the target Web application and click on "General Settings" in the Manage group of the ribbon
In the "Browser File Handling" section of the "Web Application General Settings" screen, change the radio button from "Strict" to "Permissive" (note that "Strict" is the default)
Click OK
Visit the previously offending document library in the browser - your files should now open in the respective application without prompting to save.
For full disclosure, the above procedure effectively allows all file types to be opened without being prompted to save. You can still keep "Strict" enabled and allow open for specific file types without having to open it up for all files. This is done against a specific MIME type.
An example changing this specifically for PDF documents in PowerShell using the SharePoint Management Shell:
$gc = Start-SPAssignment
$targetType = "application/pdf"
$webApp = $gc | Get-SPWebApplication http://yourwebappurl
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $targetType)
{
$webApp.AllowedInlineDownloadedMimeTypes.Add($targetType)
$webApp.Update()
}
$gc | Stop-SPAssignment