how to get the absolute path for files based on fid
Drupal 7

This is a two part process, using file_load() and file_create_url()

First, you need to turn the $fid into a Drupal URI:

$file = file_load($fid);
$uri = $file-&gt;uri;


Now, you can turn this into a URL

$url = file_create_url($uri);


file_create_url() always creates an absolute URL, either using the global $base_path that you have defined, or using the one that Drupal guessed during bootstrap.