Examines a file object and returns appropriate content headers for download.
$file: A file object.
An associative array of headers, as expected by file_transfer().
function file_get_content_headers($file) {
$type = mime_header_encode($file->filemime);
return array(
'Content-Type' => $type,
'Content-Length' => $file->filesize,
'Cache-Control' => 'private',
);
}