Skip to content

Instantly share code, notes, and snippets.

@jp1987
Created June 15, 2015 09:04
Show Gist options
  • Save jp1987/cb57994d117bde1018ca to your computer and use it in GitHub Desktop.
Save jp1987/cb57994d117bde1018ca to your computer and use it in GitHub Desktop.
Update single file in TYPO3 FAL
<?php
$storageUid = 0;
$storage = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getStorageObject($storageUid);
$storage->setEvaluatePermissions(FALSE);
/** @var \TYPO3\CMS\Core\Resource\Index\Indexer $indexer */
$indexer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\Indexer', $storage);
$file = $storage->getFile('/uploads/tx_extension/images/image.jpg');
$indexer->updateIndexEntry($file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment