docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
105 stars 97 forks source link

Filename for pdfs in zip archive do not match EnvelopeDocument.getName() #267

Closed jwill0213 closed 1 year ago

jwill0213 commented 1 year ago

When there are two files with identical names, the name of the file in the zip archive does not match what is returned by envelope.getEnvelopeDocuments().

i.e. The EnvelopeDocuments from envelope.getEnvelopeDocuments() is Filename.pdf, docId=511 Filename.pdf, docId=512

The names of the pdfs imported as a zip archive Filename.pdf Filename[1].pdf

This is specifically an issue for when a filename is too long and gets truncated. We are trying to extract individual pdfs from the zip archive and match them to their document id. The pdf only includes the filename and the bytes. We expected the EnvelopeDocuement.getName() would match what is returned but it does not.

Is this expected or a known bug? Is there another way to match a zip archive pdf to a specific docId?

ByungjaeChung commented 1 year ago

The number is added for the same file name while you download by browser or your system and it is expected behavior to avoid overwriting. So it's normal behavior and is not a DocuSign bug. To avoid this issue, you should use different file names for each of the documents or download each document separately.

jwill0213 commented 1 year ago

I understand why it is added I just think the EnvelopeDocument should include the same indicator that the file names are duplicates. We didn't intentionally upload identical names but had some files that exceeded the filename length limit.

If you are going to allow files with the same name there should be a way to tell the difference when downloading as an archive. We could download individual documents but that wastes api calls.

ByungjaeChung commented 1 year ago

Since the DocuSign system doesn't have control over which number is added as it is controlled by the browser or your system, the only solution I think is to use a different file name while you upload the document on DocuSign. The name of the file then can be an identifier to discern which document to use.

jwill0213 commented 1 year ago

I'll close this since the question was answered but I still feel DocuSign should handle this more deterministically. Thanks for the response.