Image

Drupal File Operation

This post will illustrate various handy file operations available in Drupal

Get Absolute Path of a file from URI : drupal_realpath()
A URI in drupal looks like: private://donor_registration/somefile.csv for a private file
Absolute Path: /srv/www/example.com/public_html/sites/default/private/files/donor_registration/somefile.csv