You are here

function field_file_strip_path in FileField 6.2

Same name and namespace in other branches
  1. 6.3 field_file.inc \field_file_strip_path()

Remove a possible leading file directory path from the given path.

1 call to field_file_strip_path()
filefield_check_directory in ./filefield.widget.inc
Create the file directory relative to the 'files' dir recursively for every directory in the path.

File

./field_file.inc, line 261
Common functionality for file handling CCK field modules.

Code

function field_file_strip_path($path) {
  $dirpath = file_directory_path();
  $dirlen = drupal_strlen($dirpath);
  if (drupal_substr($path, 0, $dirlen + 1) == $dirpath . '/') {
    $path = drupal_substr($path, $dirlen + 1);
  }
  return $path;
}