That really depends what your function does. If you're going to upload a file then you'll have to convert it to a Byte array, but presumably that will be done within your method. Pass the parameter as an Image and then use its Save method to save its data to a Stream, from which you can then get the data as Bytes.