Upload Image File via Creator API from iOS App

Upload Image File via Creator API from iOS App

I'm writing an iOS app that will upload information to a Creator application using the REST API.  I can upload text fine, but I can't get file uploads to work.  I'm trying to use this API, but as the example is for how to set up a web form I don't know what the structure of the POST request needs to be.  I've tried a few different ways but I either get back a status code 500 and a HTML error message or a 200 response with a message saying the request was successful but the image is not uploaded.

Has anyone managed to get this working or can give me details of how to structure the POST request outside of a web browser?