how to get the absolute path for files based on fid How can i get the absolute path for a file based on the fid? Sorry if this is a repeat, I did a search but was unable to find the answer.
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.