I'm trying to use the rest API for uploading a WORD document (*.doc) to docusign with the below code. But Exception thrown - UNABLE_TO_LOAD_DOCUMENT, Document corrupt. If I use the same document to upload directly from docusign website using my Dev Account it uploads correctly without any error. Can anyone help me to find out what's wrong with the below code. (The below code works fine for a .PDF format file)
byte[] fileBytes = File.ReadAllBytes(pathOfTheWordDocFile);
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc";
// Add a document to the envelope
Document doc = new Document();
doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes);
doc.Name = Path.GetFileName(strPath);
doc.DocumentId = "1";
envDef.Documents = new List<DocuSignModel.Document>();
envDef.Documents.Add(doc);