Getting the Attributes of a File
Permalink 1 user found helpful
Can anyone help?
I want to grab some information about each file I have.
current code contains a filtered fileset;
I dont seem to be able to get it right, I want to be able to get a list of attributes associated with the file then pull back its value.
I can work out that the getAttributes needs a file object and the $fvID but how do I work that out?.
Or the getAttributeValue uses the $avID, where can I grab that from??
I want to grab some information about each file I have.
current code contains a filtered fileset;
Loader::model('attribute/categories/file'); foreach($results as $fobj) { $at1 = FileAttributeKey::getByHandle('title'); //I thought the following would do it $title = $fobj->getAttributesValues($at1); //I Have tried //$title = $fobj->getAttributesValues('title'); }
I dont seem to be able to get it right, I want to be able to get a list of attributes associated with the file then pull back its value.
I can work out that the getAttributes needs a file object and the $fvID but how do I work that out?.
Or the getAttributeValue uses the $avID, where can I grab that from??
Hi:
I m trying to use this solution but whats those this mean,
"First create/get a file object then for each file you want to get the information for use"
I am have a PDF file list. I create a file attribute for the PDF thumbnails so i can manually insert the thumbnails for each pdf file.
do you know how can i get this attribute SRC
I m trying to use this solution but whats those this mean,
"First create/get a file object then for each file you want to get the information for use"
I am have a PDF file list. I create a file attribute for the PDF thumbnails so i can manually insert the thumbnails for each pdf file.
do you know how can i get this attribute SRC
In order to get the file returned as an object you will need to use the c5 file class
You will need to kow the id of the file you can would like information about,
There is more information about this here
http://www.concrete5.org/documentation/developers/files/files-and-f...
You will need to kow the id of the file you can would like information about,
//the following will get a file object and return it as fobj $fobj = File::getByID($fileID);
There is more information about this here
http://www.concrete5.org/documentation/developers/files/files-and-f...
Ok I think I have this one,
In order to Call an attribute on a file you can not use the same call as you can on a collection you need to use a static call to the
File Attribute class
First create/get a file object then for each file you want to get the information for use