rcdodd

How to retrieve file name of a document?

0 votes
Hello! I need to be able to pull down the name of the file that was uploaded with a document in a given package. I see that there is a "FileName" property on the "Document" object, but when I pull a package down and loop through its documents, the FileName is always null. Any assistance would be greatly appreciated! I was directed to this forum from Support. Thanks!

Reply to: How to retrieve file name of a document?

0 votes
Hey, The sample code below will show you how to retrieve the document names in a package. The first step is to retrieve the package. Once you have it, you need to loop through the list and print out the document names. Let me know if it helps.
 public static void Main(string[] args)
        {
            string apiKey = "your_api_key";
            string url = "https://sandbox.esignlive.com/api";

            EslClient esl = new EslClient(apiKey, url);

            PackageId packageId = new PackageId("d9355f04-9bb2-4219-b9fa-734f2650a939");
            DocumentPackage package = esl.GetPackage(packageId);

            IList documentsHistory = package.Documents;

            for (int i = 0; i 
Haris Haidary OneSpan Technical Consultant

Reply to: How to retrieve file name of a document?

0 votes
Haris, Thank you, but I have no problems getting at the "Name" property. There is a similar property on that object, called "FileName" for (int i = 0; i

Reply to: How to retrieve file name of a document?

0 votes
Do you require something else that "documentsHistory[i].Name" doesn't give?
Haris Haidary OneSpan Technical Consultant

Reply to: How to retrieve file name of a document?

0 votes
I need the name of the file that was uploaded, not the title of the document. For example: documentsHistory[i].Name == "Power of Attorney Form" documentsHistory[i].FileName == "poa.doc"

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off