1

I'm using Drupal 7 and having File 7.14 field installed.I have a content type (named file) containing more than 1 file. I have a view that shows the filesize of all the files of the content of that content type named file. For doing that I have added a relationship in Views to "select File Usage: File" The filesize is nicely shown for content that contains only one 1 file.

However for content containing more than 1 file the filesize is only shown for the first file but not for the 2nd 3th etc.

Here is how my query currently looks like:

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language,   file_managed_file_usage.filesize AS file_managed_file_usage_filesize, 'node' AS  field_data_field_file_node_entity_type
FROM 
{node} node  
LEFT JOIN {file_usage} file_usage ON node.nid = file_usage.id AND file_usage.type = 'node'
LEFT JOIN {file_managed} file_managed_file_usage ON file_usage.fid = file_managed_file_usage.fid
WHERE (((node.status = '1') AND (node.type IN  ('file'))))
ORDER BY node_title ASC  
LIMIT 50 OFFSET 0

Can anybody explain me how to change the View settings so that the filesizes of the other files are also be visible?

1 Answer 1

0

Actually it works fine for me without additional settings

My configuration :

  1. I used content-type : Article and create some fields file
  2. Your first step is good, you need to add a relationship select File Usage: File
  3. Then in your fields section you can add : Content: Title , File: Size, File: Name settings result

I have a listing of all the name of the file with their size. If you want you can group by Articles. result2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.