---
title: "UploadVendorInvoiceAttachment"
canonical: "https://docs.dk.is/space/DEV/10355856/UploadVendorInvoiceAttachment"
format: markdown
---
This function is used to upload and attachment to and vendor invoice

## Parameters

Used to call the function

1. id - Integer
2. [TAttachmentFile](https://dkdocs.atlassian.net/wiki/spaces/DEV/pages/10357326)

## Returns

Returns the following

- NONE



##### **Upload Attachment**

```csharp
            IItemServiceservice service = new IItemServiceservice();
            service.BasicSecurityValue = new BasicSecurity() { Username = "ws.dev", Password = "Code2make" };
            var invoice = new TVendorInvoice()
            {
                Amount = 1000,
                CurrencyCode = "ISK",
                InvoiceDate = DateTime.Now,
                InvoiceNumber = "SK-1235",
                Reference = "DK985",
                Vendor = "default",
                InvoiceType = TComboBox_DebCred._cbCredit
            };
            string filename = "2017-05-25-F13F35C6-DE84-4E05-986B-D5F0FE4188DD.pdf";
            service.UploadVendorInvoiceAttachment(invoice.ID, new TAttachmentFile() { Name = filename, Data = System.IO.File.ReadAllBytes(@"C:\temp\"+ filename) });



```

 

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | **Related issues** |  |
> | --- | --- |