owncloud/core — pull request #4766 by butonic (2013-09-08 09:02:09+00:00)
Title: file upload conflicts dialog

When uploading an already existing file in OC5 we currently autorename the uploaded file and append a number in brackets. This is a regression from OC4.5 where users were given a choice how to handle a conflict as in every other operating system. This PR adds back a conflicts dialog that pops up when a file already exists on the server:
![bildschirmfoto vom 2013-09-08 10 48 42](https://f.cloud.github.com/assets/956847/1102832/7fe18d42-1863-11e3-8a3b-628927201551.png)

Technically, the server will deny an upload when a file already exists and return an 'alreadyexists' error. The browser then shows this dialog and adds subsequent conflicts to it. It uses OC/Preview (kudos @georgehrke) to show thumnails for existing files on the server and shows previews for images to be uploaded when the FileReader API is available (kudos @icewind1991).

If modification times differ the older one is highlighted bold. If sizes differ the bigger one is highlighted bold. As IE8 has no FileReade API it looks like this:
![bildschirmfoto vom 2013-09-06 23 55 09](https://f.cloud.github.com/assets/956847/1102845/6c3e139a-1864-11e3-8288-87cf4e6f8e2f.png)

IMHO not too bad.

This is a fallback dialog we will always need because thy sync client or another user / browser might have uploaded a file that we do not know of and the server will now correctly answer with the 'alreadyexists' error.

While this is the minimum we need for file uploads I'll write a design forward for file upload to discuss what can still be improved.

@karlitschek @bartv2 @icewind1991 @DeepDiver1975 @msrex please review. I know about the limitations of this implementation but I won't start going into them unless you discover them. So go ahead and try to break it.