How to download a file from private file system I need a function in my module for users to download a file from a private filesystem.

$file : "private://sample.csv"


Which function should be used, file_download(), or  file_transfer()?

function file_download_page() {
  $file = "private://sample.csv";
  //code for downloading $file
}    


Please provide sample code.
You just need to call file_create_url().

It will return an URL that will go through Drupal which will then check the appropriate permiss (if you need custom checks, you need to implement hook_file_download)