[FLOW3-general] Accessing Resources on Filesystem
David Sporer
david.sporer at gmail.com
Wed Sep 5 14:12:22 CEST 2012
Oh now I understand.
I'm doing something similar (but I'm not sure if it's good to do so) - I'm
creating a temporary folder where I store all files I want to add to the
zip-File (a Passbook-Pass is basically a zip-file) add the zip-file as a
resource and delete the tmp-folder afterwards.
Hope this helps:
//create tmp-folder
//$environment is an instance of \TYPO3\FLOW3\Utility\Environment
$this->tempPath = $environment->getPathToTemporaryDirectory() .
uniqid('Passbooks_PassInstanceCreation_');
mkdir($this->tempPath);
Saving files to this folder shouldn't be a problem at all.
But I would really appreciate it if anyone of the FLOW3-Core Members could
say if this is a convenient way or if there's a better way to to this
(means to create zip-files from Resources).
Regards
David
2012/9/5 Martin <titusmailing at googlemail.com>
> Hi David,
>
> thanx for your example but its not exactly what I need.
>
> I have users uploading their Homework, and the Tutors needs to Download
> these all of these files as a zip file.
>
> So creating links after generating a file is not exactly my problem. First
> of all I need to gather all file in one ZIP-File. But hte FLOW3-Magic (and
> my knowledge about it) is just blocking my process.
>
> It's written in the documentary not to access files directly, but this is
> what I need or another workaround, without changing the flow3 safety.
>
> Regards
>
> Martin
>
>
> On 09/05/2012 01:09 PM, David Sporer wrote:
>
>> Hi Martin,
>>
>> as far as I know this is not the way Resources are meant to be used.
>> If you have a model that contains the resources and/or your zip-file
>> publishing the resources would be the right way. So you're generating the
>> link to the resource in your fluid template.
>> E.g. this is what I'm doing on http.//demo.passbooks.de - as soon as the
>> file is created a fluid Template is shown that contains the downloadlink.
>> If you really want to have links to the files then you might need to save
>> your zip-files as static resources but I don't know if there's a way to
>> dynamically create static Resources.
>>
>> Regards
>> David
>>
>> 2012/9/5 Martin<titusmailing@**googlemail.com<titusmailing at googlemail.com>
>> >
>>
>> Dear Listmembers,
>>>
>>> I need to organize the Resources in a defined Folder structure and making
>>> it accessible for users to Download.
>>>
>>> So I don't need to Publish the resources but after packing it in a zip
>>> File.
>>>
>>> I tried to get the Path and real Filename via
>>>
>>> $this->resourcePublisher->****getPersistentResourceSourcePat**
>>> **hAndFilename()
>>>
>>> But this attempt ends up in an Error.
>>>
>>> Resources shouldn't be accessed on Filesystembase, but in this case I
>>> have
>>> to.
>>>
>>> What is the best approach for this, I can't find any useful methods or
>>> classes in the baseRepo.
>>>
>>> Cheers Martin
>>> ______________________________****_________________
>>> FLOW3-general mailing list
>>> FLOW3-general at lists.typo3.org
>>> http://lists.typo3.org/cgi-****bin/mailman/listinfo/flow3-****general<http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow3-**general>
>>> <http://lists.typo3.**org/cgi-bin/mailman/listinfo/**flow3-general<http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general>
>>> >
>>>
>>> ______________________________**_________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow3-**general<http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general>
>
More information about the FLOW3-general
mailing list