/// <summary> /// Add a file to the signature request by giving its local path. /// </summary> /// <param name="path">Full path to file to upload.</param> /// <param name="contentType">The MIME type of the file to upload.</param> /// <returns></returns> public FileSignatureRequestBuilder AddFile(string path, string contentType = null) { if (FileUrls.Count > 0) { throw new NotSupportedException("Cannot add local and remote files in the same request"); } var file = new FileContainer(); file.Path = path; file.ContentType = contentType; Files.Add(file); return(new FileSignatureRequestBuilder(file, this)); }
/// <summary> /// Add a file to the signature request by providing a Stream. /// </summary> /// <param name="writer">Input stream delegate that will provide the file data.</param> /// <param name="filename">Filename this file should appear to the server as.</param> /// <param name="contentType">The MIME type of the file to upload.</param> /// <returns></returns> public FileSignatureRequestBuilder AddFile(Action <System.IO.Stream> writer, string filename, string contentType = null) { if (FileUrls.Count > 0) { throw new NotSupportedException("Cannot add local and remote files in the same request"); } var file = new FileContainer(); file.Writer = writer; file.Filename = filename; file.ContentType = contentType; Files.Add(file); return(new FileSignatureRequestBuilder(file, this)); }
public FileSignatureRequestBuilder(FileContainer file, SignatureRequest request) { _file = file; _request = request; }