Is there a way to determine if a file already exists in the repository?

When we create a new document with an attached file, we would like to check whether the file exists and refer the new document's file:content property to the existing blob instead of copying the same file into the repository over and over again. Is there a way to do this?

0 votes

2 answers



Although it's the same file (blob), it includes a new … What should I do?


0 votes

  1. this site uses English
  2. this is not an Anwser, so don't post it in the Answers section
  3. "me too" comments are generally useless


This is the default behaviour of Nuxeo (VCS). If two binary objects are the exact same then only a single binary will be stored. Effectively, multiple documents will be pointing to the same underlying binary object.

0 votes

We do only get one copy in the repository, but it seems that it copies the new file over the old file. We have an external process that is accessing the file. It occasionally gets a "Stale NFS file handle" error, indicating that something has deleted and recreated the file. Also, the time stamp on the file is the time of the later copy, not the time of the original ingest. We are trying to avoid the stale handle error.

Didn't ever notice that, but it seems like a bug to me, or at the very least should be easily configurable to work with either scenario. I will have to take a second look.

We're using an atomic move/rename to the MD5 of the file when uploading a new file. For atomicity reasons and to guarantee proper backups we cannot do otherwise. We've never had reports of stale NFS file handles, what's your NFS version and implementation?

Any updates ?