Hi! I am trying to upload images to teambox.com using curl and php, but I always get the error "Invalid file name", "you can't upload a blank file", and "Invalid Record".
Any suggestions on how to fix it?

here's my code:

$fields = array(
    'file' => file_get_contents($_FILES['upload_field_'.$task_id]['tmp_name'])

$fields_string = http_build_query($fields);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$http_result = curl_exec($ch);
$error       = curl_error($ch);
$http_code   = curl_getinfo($ch ,CURLINFO_HTTP_CODE);


The API states you need to pass 4 parameters, and none of them is named 'file'. In line 13 you use $json_string but it isn't defined anywhere.