2009-07-09 84 views
0

我想为我的文件上传获取文件路径,例如/sites/default/files/myfile.pdfdrupal中sql查询的文件路径

我用下面的:

$row['node_data_field_factsheet_field_factsheet_data'] 

这将返回a:1:{s:11:"description";s:0:"";}

我如何获得的实际路径?

这里是我的SQL语句:

SELECT node.nid AS nid, 
node_data_field_factsheet.field_factsheet_fid AS node_data_field_factsheet_field_factsheet_fid, 
node_data_field_factsheet.field_factsheet_list AS node_data_field_factsheet_field_factsheet_list, 
node_data_field_factsheet.field_factsheet_data AS node_data_field_factsheet_field_factsheet_data, 
node.type AS node_type, 
node.vid AS node_vid 
FROM node node 
LEFT JOIN content_type_fund node_data_field_factsheet ON node.vid = node_data_field_factsheet.vid 
WHERE node.type in ('fund') 
+0

属于drupal.stackexchange.com – Cyclonecode 2014-03-21 02:17:50

回答

2

你并不需要使用SQL。只需在File API中调用Drupal的file_create_path('myfile.pdf')函数即可。