demellor | Posts: 46

Adding a text file via .NET API

0 votes

Using the OneSpanSign.sdk there is no document type for text files, which may or may not have the TXT extension.  I can drag and drop files via the UI into transactions but I don't see any easy way using the API to upload them.


Duo_Liang | Posts: 3776

Reply to: Adding a text file via .NET API

0 votes

Hi Richard,

 

If we are talking about using .NET SDK to upload .txt file, I believe there are two methods:
DocumentBuilder.NewDocumentNamed("Sample Agreement")
                .FromStream(File.OpenRead("path_to_file\\contract.txt"),DocumentType.PDF)

                 or

                .FromFile("path_to_file\\contract.txt")

 

From my test, even for the first method which requires a stream and a document type, passing in DocumentType.PDF didn't cause an error for me.

 

Duo

 

 


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