Playing with Files in Drupal

Drupal has file URI of the format similar to


Where there are several datasets

  • public
  • private
  • temporary

There are several functions that are useful to know;

The local path in the local File System

$path = drupal_realpath($uri);

The external URL referenced from the web server

$url = file_create_url($uri);

There are more in the reference.

Leave a Reply