Hi. Thank you for your response.
"file1.txt" with content "Hello World". Now I upload another file called "file1.txt" with the content "middleworld". The file is detected as duplicated, but clearly it isn't.
Correct, but this is precisely what they want -- they need to be notified that someone did that and then examine the situation manually.
Now, why do you want to detect duplicates? ownCloud provide its own storage view to each user.
This particular use case is that all files are stored in one user's space and they want to know, for example, if someone uploads a duplicate file with the name Video-Venice Beach-2014-June.mp4 because given they way they are used to storing their data, that would be a red flat that they would want to be alerted to in order to investigate.
I think such app will be a waste of time and won't work as everyone would expect.
All we need is to run this search every time a file is added, or a name changed I suppose. I would have to investigate the details more, but perhaps searching the filecache table might indeed be sufficient.
Note that, in addition, I don't think any FS has the option to detect duplicate files, so I wonder if ownCloud can implement this.
There is fslint, fdupes, dupeGuru, SearchMyFiles, Duplicate Files Finder and others. The point is that duplication detection is a real need that some people have.
The other option is to write an independent script to use fdupes and run it via cron.