Sometimes you have links to downloadable files and attachments displayed, and besides making that field a clickable link to the actual files for downloads you may also want to display the following file information alongside the link:
- File Size
- File Type
To do that using Views, you will need to be able to use and insert the relevant fields. These fields are available in as File Usage.
- Go to your Views > Advanced > Relationships
- Under Relationships, search and add “File Usage”
Add and insert File Usage, Ok.
- On the same Views page, under Fields, you should now be able to search and add file type (File: Mime type) and file size fields
- Done! Go ahead test and format the views display some more.
To avoid duplicates, if appearing, you may:
Add and bind Relationships
- Go to your Views page
- Add Relationships (in my example, take note of entity bound set between the two relationship items – field ID and file field content)
Set strict query settings
- Go to your Views page > Other settings > Query Settings)
- Select Distinct, Pure Distince (either or both, whichever works best)