public async Task TransientDocument() { await this.RefreshTokenAsync().ConfigureAwait(true); byte[] file = System.IO.File.ReadAllBytes(@"C:\Liviu\Dev\DocumentFull1.pdf"); string fileName = "DocumentFull1.pdf"; var transientDocument = client.UploadTransientDocument(fileName, file); }
//[HttpPost] //[Route("api/AdobeSign/PostTransientDocument")] public TransientDocument PostTransientDocument([FromUri] string fileName) { var httpRequest = HttpContext.Current.Request; var postedFile = httpRequest.Files[0]; var fileStream = postedFile.InputStream; byte[] fileByte; using (BinaryReader br = new BinaryReader(fileStream)) { fileByte = br.ReadBytes((int)fileStream.Length); } this.RefreshToken(null); var transientDocument = client.UploadTransientDocument(null, fileName, fileByte).Result; return(transientDocument); }