Understanding hash_mismatch errors with Document Engine

Information

PSPDFKit Server has been deprecated and replaced by Document Engine. To migrate to Document Engine and unlock advanced document processing capabilities, refer to our migration guide. Learn more about these enhancements on our blog.

Question: What does the hash_mismatch error response mean?

Answer:

When you upload documents from a URL, PSPDFKit Server calculates SHA256 hash of its contents and stores it in the database. Since the file is stored in your infrastructure, PSPDFKit Server fetches it when necessary, e.g. in order to render it for viewing. When the fetched document’s SHA256 doesn’t match the hash that was stored on upload, a hash_mismatch error is returned.

To prevent this error, you must make sure that the URL you provided on upload always returns the exact same file.