Drupal 7: Get files public directory path

We used to get the files directory using file_directory_path() in Drupal 5 and 6, the function was removed with Drupal 7 but you can still get the files public directory like this:

echo variable_get('file_public_path', conf_path() . '/files');

// Outputs: sites/default/files

Leave a Reply

Your email address will not be published. Required fields are marked *