Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果这是我存储文件的文件夹路径:file.tx
$directory= variable_get('file_directory_path', 'sites/default/files');
如何获取文件的路径:file.txt?
试试下面的代码。下面的代码用于获取 drupal 文件 url。
$fileuri= variable_get('file_public_path', conf_path() . '/files').'/file.tx'; $file_url = file_create_url(file_build_uri($fileuri));
对于私人文件夹,使用“file_private_path”。
默文