[TYPO3-dev] Add pictures / files directly to sys_file table, ...

Frans Saris franssaris at gmail.com
Tue Jun 10 11:11:40 CEST 2014


Hi Dirk,

to index a file just place the file in fileadmin and
call TYPO3\CMS\Core\Resource\getFileObjectByStorageAndIdentifier($storageUid,
$fileIdentifier);

For file fileadmin/test.jpg in a default TYPO3 installations that would be:
TYPO3\CMS\Core\Resource\getFileObjectByStorageAndIdentifier(1, '/test.jpg');

The record in sys_file and sys_metatdata are automatically created then.

But if you use ext:tt_news it doesn't make sense to use this as this
extension doesn't use FAL.

ext:news does use FAL and has an import API you can use to import your
newsitems. See https://github.com/georgringer/mailtonews and
https://github.com/fsaris/news_ttnewsimport for some examples how you can
use this import API.

gr. Frans


2014-06-09 22:41 GMT+02:00 Dirk Ho <dirk_studivz at web.de>:

> Hi all,
>
> I want to parse our member newsletters, send via mailman, in a cronjob
> script and add them directly to the typo3 database and add them as a
> tt_news entry.
>
> Therefore I need to know, how the tables work and are related. I guess I
> have to put the file to upload anywhere in fileadmin and add this path to
> the sys_file, also. For each file I also add an entry in file_metadata.
>
> What do I have to add to sys_file_reference, sys_file_processedfile,
> sys_file_collection, sys_filemounts to be able to reference the uploaded
> file in tt_news table?
>
> It would be great if you could help me to get this work.
>
> Thanks and best wishes,
>
> Dirk
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list