Skip to content

Instantly share code, notes, and snippets.

@s2b
Created August 13, 2014 12:45
Show Gist options
  • Save s2b/6b2df1dfbb398e8203ce to your computer and use it in GitHub Desktop.
Save s2b/6b2df1dfbb398e8203ce to your computer and use it in GitHub Desktop.
TYPO3/ExtBase: Get upload path from TCA
<?php
class SomeClass{
protected function getUploadPath($table, $field) {
global $TCA;
$cObj = $this->configurationManager->getContentObject();
t3lib_div::loadTCA($table);
return $cObj->typoLink_URL(array(
'parameter' => trim($TCA[$table]['columns'][$field]['config']['uploadfolder'], '/') . '/'
));
}
}
@s2b
Copy link
Author

s2b commented Aug 13, 2014

In a pre-FAL situation I use this snippet to get the upload path of a file from the TCA record of the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment