VBA File Upload POST Request

Hi all,
Would anyone have any knowledge about translating a CURL request in VBA to upload a file to my Knack application?

Below is what is demonstrated in the API & Customization wiki at https://www.knack.com/developer-documentation/#file-image-uploads.

curl -X POST "https://api.knack.com/v1/applications/YOUR-APP-ID/assets/file/upload" 
\ -H 'content-type: multipart/form-data' \ -H 'x-knack-rest-api-key: YOUR-API-KEY'
\ -F "files=@/path/to/your/file.txt"

Here's what I've done so far in VBA with no success:

Sub PostFile()

Dim URL As String
Dim fileUpload As String
Dim objHTTP As New WinHttpRequest

URL = "https://api.knack.com/v1/applications/APPLICATION_ID/assets/file/upload"
objHTTP.Open "POST", URL, False
objHTTP.SetRequestHeader "X-Knack-REST-API-KEY", "API_KEY"
objHTTP.SetRequestHeader "Content-Type", "multipart/form-data"

fileUpload = "files=@\\wnsomfs01\desktops\schapman\File\inspection2.pdf"
objHTTP.Send JSONString
MsgBox (objHTTP.ResponseText)

End Sub

This currently returns the following:

Hi Stephen, I haven't done it yet with VBA so I don't have any working code but it looks like you're sending a null - JSONstring isn't dimensioned or set in your code.

Try sending the fileupload string to see what returns - I'm keen to see what happens here.

And I recommend setting Option Explicit for all VBA modules to help catch stray variables - The VBa Editor Tools > Options > Require Variable Decalration setting turned on will always add this for new modules.