1

I'm building a small form for what is to be a simplified document system. I'm working with two lists, where the first is a list of all documents in a directory each with a unique ID and the other list is used to add some metadata to it.

My challenge is, how do I ensure that once I upload a file it checks my repository if the same content already exists (for example, if I try to upload fileB.docx but it is a duplicate of a file that already exists in there called file123.docx, only different name), and if file already exists (even under different name) it returns me the ID of that file, if not it creates a new file.

Any tips?

I thought about using MD5 hash, but I don't know if there are any drawbacks on proceeding as such.

2
  • This custom file uploader (that you need), is in SharePoint Onpremises or Online? Jul 6 at 12:19
  • @AntonioLeonardo , it's sharepoint Online.
    – victorpbr
    Jul 7 at 13:55
1

You would need to store the file hash as a column for each document

Before you save the file you could check if the hash exists.

A hash is a unique identifier based on the contents of the file

Try PowerShell command Get-FileHash

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.