[Flow] Getting temp path to ./Data/Temporary/....

Rémy DANIEL dogawaf at no-log.org
Mon May 25 22:24:54 CEST 2015


Hi Sascha

You can inject environment in your class:

/**
* @var \TYPO3\Flow\Utility\Environment
* @Flow\Inject
*/
protected $environment;

And then get the path to the temp directory:

$temDirectory = $this->environment->getPathToTemporaryDirectory();

I also suggest that you create a subfolder for your namespace:

\TYPO3\Flow\Utility\Files::createDirectoryRecursively($temDirectory .
'MyCompany');

Cheers
Rémy


Le jeu. 21 mai 2015 à 10:03, Sascha Reule <mail at sascha-reule.de> a écrit :

> Hello,
>
> I’m using Flow (3.0.0-beta2) to create dynamically a Pdf file from a
> rendered Fluid template with the TCPPDF PHP library.
> This works very well, but now I want to cache the created Pdf files
> somewhere temporarely, because a second process creates images from this
> Pdf files.
>
> I think the ./Data/Temporary/%CONTEXT%/[MyPackage/pdfs] directory will be
> a good place to store the pdf files.
> How can I access this directory respectively get the path to this
> directory?
>
> Thx you!
>
>
> Sascha Reule
> Sent with Airmail
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow


More information about the Flow mailing list