I have a fid of an image field from file_managed table . Using file_usage table I can get the Node ID with which fid is associated. My requirement is how I can get the image field info of that Node with which my fid is associated since Node got many image fields? Any drupal core function which may help me to get field information based on fid.

Thanks is advance.

Comments

nevets’s picture

Are you looking for file_load()?

maheshg85’s picture

file_load gives me a file object and only file related info like size,mime etc and not the field related information. What I doing is, listing the all the images from file_managed table in a HTML table format . I also need to show in my listing to which node does image belongs to and with which image field it associated . Using file_usage I can get the node. but how I can get the field through which Image has been uploaded. I have fid and node id with me.

prathamesh T.’s picture

Hi Mahesh,

have got any solution for this, please let me know what you did for this?