It was hard to figure out how to actually post files with this function. The "Array of files to post" is an array of associative arrays, each need the keys "name", "type" and "file". Consider this example code:
<?php
$files = array(
array(
'name' => 'somename',
'type' => 'text/plain',
'file' => $filename
)
);
$http_response = http_post_fields($url, $data, $files);
?>