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

2136 views

ANSWER



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

Heeelp

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
06/01/2017

ok
06/01/2017


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.
08/16/2012

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.
08/17/2012

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?
08/21/2012

Any updates ?
08/28/2012