Get file system path of a files content folder

Yes, if the meta file at least has the desired file blueprint declared in it (which i added manually).

Then you have to create the meta data file in your method or in the hook and you probably don’t have to publish it.

Yes… this works and they show up in the panel without having to reload it…

'getIDart' => function() {

	// Write File

	$contentpath = $this->parent()->root();

	// image file
	$audioartfilename = substr($this->filename(), 0, -4) . '-art.jpg';
	$audioartfilepath = $contentpath.'/'.$audioartfilename;
	$audioart = explode( ',', $this->id3('cover'));
	$audioartdecode = base64_decode($audioart[1]);

	// Meta File
	$audioartmetafilename = substr($this->filename(), 0, -4) . '-art.jpg.txt';
	$audioartmetafilepath = $contentpath.'/'.$audioartmetafilename;
	$metacontent = 'template: imagefocus';

	// Create Meta
	F::write($audioartmetafilepath, $metacontent);

	// Create Cover File
	F::write($audioartfilepath, $audioartdecode);

	return $audioartfilename;
},
1 Like