Meyn.TestLink.TestLink.UploadExecutionAttachment C# (CSharp) Method

UploadExecutionAttachment() public method

Uploads an attachment for an execution.
The attachment content must be Base64 encoded by the client before sending it.
public UploadExecutionAttachment ( int executionId, string filename, string fileType, byte content, string title = "", string description = "" ) : AttachmentRequestResponse
executionId int
filename string The file name of the Attachment (e.g.:notes.txt)
fileType string The file type of the Attachment (e.g.: text/plain)
content byte The content (Base64 encoded) of the Attachment
title string The title of the Attachment
description string The description of the Attachment
return AttachmentRequestResponse
        public AttachmentRequestResponse UploadExecutionAttachment(int executionId, string filename, string fileType, byte[] content, string title = "", string description = "")
        {
            stateIsValid();
            string base64String;
            try {
                base64String = Convert.ToBase64String(content, 0, content.Length);
            } catch (ArgumentNullException) {
                // System.Console.WriteLine("Binary data array is null.");
                base64String = "";
            }
            object response = proxy.uploadExecutionAttachment(devkey, executionId, filename, fileType, base64String, title, description);
            handleErrorMessage(response);
            AttachmentRequestResponse r = new AttachmentRequestResponse(response as XmlRpcStruct);
            return r;
        }