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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -