We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Is there any specific metadata which can be used to identify a document uniquely?

Is there any specific metadata which can be used to identify a document uniquely? ie imagine we stored some metadata of a document (using doc.getBuiltInDocumentProperties()), when a user re-upload the same document with few modifications , is there any way we can find out, whether its the same document or not .

@1623751199347 There is no such metadata. However, you can use Compare feature to check whether the document has been edited. For example you can use code like the following:

Document docA = new Document(dataDir + "DocumentA.doc");
Document docB = new Document(dataDir + "DocumentB.doc");
docA.compare(docB, "user", new Date());
if (docA.getRevisions().getCount() == 0)
	System.out.println("Documents are equal");
else
	System.out.println("Documents are not equal");

But Compare feature wont help me to check whther docA and docB are same or not right ( even if docB is edited). what about comparing the combination of core/extended/custom property values ?does it make a unique combination ?

@1623751199347 Unfortunately, there is no such combination to use as document ID. If you have control over document creation, you can add such custom property into the document and use it as an identifier. But this property can always be removed.

Okay…Thank you alexey

1 Like