php - Drupal 7 find the path of a given file name -
if folder path stored file: file.tx
$directory= variable_get('file_directory_path', 'sites/default/files');
how path of file: file.txt?
try code below. below code drupal file url.
$fileuri= variable_get('file_public_path', conf_path() . '/files').'/file.tx'; $file_url = file_create_url(file_build_uri($fileuri));
for private folder use 'file_private_path'.
mervyn
Comments
Post a Comment