var model = new FileAttachmentInsertRequestModel()
{
EnableLogging = false,
FileAttachments = new FileAttachmentInsertModel[]
{
new FileAttachmentInsertModel()
{
TaskID = 1234567890,
FileBytes = System.IO.File.ReadAllBytes(@"C:\myAttachment.jpg"),
FileMimeType = "application/pdf",
FileName = "My File Attachment Test.pdf"
}
}
};
var results = serviceClient.InsertFileAttachments(sa, model);
if (results.IsSuccessful)
{
//do work...
}
else
{
//handle error
}
Dim model = New FileAttachmentInsertRequestModel() With {
.EnableLogging = False,
.FileAttachments = New FileAttachmentInsertModel() {New FileAttachmentInsertModel() With {
.TaskID = 1234567890,
.FileBytes = System.IO.File.ReadAllBytes("C:\myAttachment.jpg"),
.FileMimeType = "application/pdf",
.FileName = "My File Attachment Test.pdf"
}}
}
Dim results = serviceClient.InsertFileAttachments(sa, model)
If Not results.IsSuccessful Then
'do work...
Else
'handle error
End If