0

I'm wanting to get the filepath ie /sites/default/files/myfile.pdf for my file uploads.

I'm using the below:

$row['node_data_field_factsheet_field_factsheet_data']

this returns a:1:{s:11:"description";s:0:"";}

How do i get the actual path?

Here is my sql statement:

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')
1
  • belongs on drupal.stackexchange.com Commented Mar 21, 2014 at 2:17

1 Answer 1

2

You don't need to use SQL. Just call Drupal's file_create_path('myfile.pdf') function in the File API.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.