Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

Chapter 11. FTPd & Webdav webmount transformations

11.1. Uploads

Upload transformations are based on  extension and name of uploaded file on a unitary basis.

Default transformations

html,htm : TT_CONTENT of cTYPE HTML

text,txt : TT_CONTENT of cTYPE TEXT

all other file extensions : TT_CONTENT of cTYPE UPLOADS

How to add/modify transformations

In the page TSCONFIG for uploads

plugin.tx_metaftpd.<ext>.put.table

Record table to create

plugin.tx_metaftpd.<ext>.put.dataField

If set content of file after transformation will be put into this field

plugin.tx_metaftpd.<ext>.put.table.ctype

plugin.tx_metaftpd.<ext>.put.fileField

If set uploaded file will be added to this field

plugin.tx_metaftpd.<ext>.put.FlexFormFileField

plugin.tx_metaftpd.<ext>.put.headerField

If set name of file will be uploaded to this field

plugin.tx_metaftpd.<ext>.put.systemTransform

If set file will be transformed by this system command after upload, content of transformed file will be set in dataField

plugin.tx_metaftpd.<ext>.put.sizeLimit

If set data length will be cropped at this max size. Should prevent data overflows in php ...

plugin.tx_metaftpd.<ext>.put.stdWrap

If set transformed data will be processed by TYPO3 stdWrap function

1. Not yet implemented :

plugin.tx_metaftpd.allowed

Allowed file types in page

plugin.tx_metaftpd.<ext>.put.maxsize

File size check

plugin.tx_metaftpd.<ext>.put.crop

Crop transformation content

plugin.tx_metaftpd.<ext>.put.cleancomments

plugin.tx_metaftpd.<ext>.put.striptags

plugin.tx_metaftpd.<ext>.put.stdWrap

plugin.tx_metaftpd.<ext>.showColDirs

Show page columns as directories

plugin.tx_metaftpd.<ext>.showLangDirs

Show languages as directories, each eventualy containing column dirs

plugin.tx_metaftpd.<ext>.showVersionDirs

Show Version as directories, each eventualy containing column dirs

plugin.tx_metaftpd.<ext>.showTableDirs

List of tables of which content should be shown as different sub directories. Example: tt_news,tt_adress

plugin.tx_metaftpd.<ext>.put.userFunction

User function to call after  transformation

plugin.tx_metaftpd.<ext>.if

Other configurations which may apply if conditions are met

plugin.tx_metaftpd.<ext>.if.<config number>.requiredextension

If this extension is loaded the following configuration will be taken into account

plugin.tx_metaftpd.<ext>.if.<config number>.requiredsystemcmd

(test if executable exists)... ??

plugin.tx_metaftpd.<ext>.if.<config number>.filecontains

(header analysing ??) charset identifcation ... mime_type indentification ????

plugin.tx_metaftpd.<ext>.if.<config number>.put

Alternate put configuration

plugin.tx_metaftpd.<table>.filenametemplate

Default file name template for content is 'T3[###UID###][###CTYPE###].###TX_METAFTPD_FTPD_FILE###'

Default file name template for pages is 'T3[###UID###][###TITLE###]

Gonna have to be carful with this since the format allow to recover uid from filename ... Maybe Webdav properties will help ...

plugin.tx_metaftpd.<begroupid>.showUploadsDir

Show upload dir in web mounts

plugin.tx_metaftpd.<begroupid>.showExtDir

Show typo3conf/ext dir in web mounts

plugin.tx_metaftpd.admin.showExtDir

plugin.tx_metaftpd.admin.showUploadsDir

Interesting software

/usr/local/bin/zipinfo -2zt %s

/usr/local/bin/pdftotext %s -enc UTF-8 -layout -

/usr/local/bin/ppthtml %s

/usr/local/bin/wvWare %s

/bin/tar -tzvf %s

/usr/bin/unrtf %s --nopict -t html

/usr/local/bin/xlhtml -nh %s

mp3info

o3tohtml

utf8tolatin

unace

id3

id3v2

gunzip

unzip

recode

Page TSCONFIG examples (executables locations & parameters may change according to server configuration)

This is probably the part where alle the fun lies, getting your platform to transform file types accordingly to customer needs can be a nightmare, espacially when charset problms come in the picture ...

This stuff is stille pretty experimental but the result when it works is great ...

plugin.tx_metaftpd.xls.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/xlhtml -nh '%s' | /usr/local/bin/utf8tolatin1

}

plugin.tx_metaftpd.ppt.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/ppthtml '%s' | /usr/local/bin/utf8tolatin1

}

plugin.tx_metaftpd.doc.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/wvWare '%s'

}

plugin.tx_metaftpd.rtf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/unrtf '%s' --nopict -t html | sed 's/<!-- char 0xe9 -->/\&eacute;/g'

}

plugin.tx_metaftpd.zip.put {

table=tt_content

headerField=header

dataField=bodytext

sep=<br>

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/zipinfo -2zt '%s'

}

plugin.tx_metaftpd.tgz.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

fileField=tx_metaftpd_ftpfile

systemTransform=/bin/tar -tzvf '%s'

}

plugin.tx_metaftpd.tar.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

fileField=tx_metaftpd_ftpfile

systemTransform=/bin/tar -tvf '%s'

}

plugin.tx_metaftpd.sxw.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/unzip -p '%s' content.xml | /usr/local/bin/o3tohtml | /usr/local/bin/utf8tolatin1

}

plugin.tx_metaftpd.flv.put {

table=tt_content

headerField=header

#dataField=bodytext

ctypeField=ctype

ctype=list

listTypeField=list_type

list_type=

fileField=tx_metaftpd_ftpfile

#systemTransform=unzip -p '%s' content.xml | /usr/local/bin/o3tohtml | /usr/local/bin/utf8tolatin1

}

plugin.tx_metaftpd.pdf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/pdftotext '%s' -enc Latin1 -layout -

}

plugin.tx_metaftpd.mp3.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/mp3info '%s'

}

plugin.tx_metaftpd.xls.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/xlhtml -nh '%s'

}

plugin.tx_metaftpd.ppt.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/ppthtml '%s'

}

plugin.tx_metaftpd.doc.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/wvWare '%s'

}

plugin.tx_metaftpd.rtf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/unrtf '%s' --nopict -t html | sed 's/<!-- char 0xe9 -->/\&eacute;/g'

}

plugin.tx_metaftpd.zip.put {

table=tt_content

headerField=header

dataField=bodytext

sep=<br>

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/zipinfo -2zt '%s'

}

plugin.tx_metaftpd.tgz.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=/bin/tar -tzvf '%s'

}

plugin.tx_metaftpd.tar.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=/bin/tar -tvf '%s'

}

plugin.tx_metaftpd.sxw.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/local/bin/unzip -p '%s' content.xml | /usr/local/bin/o3tohtml

}

plugin.tx_metaftpd.flv.put {

table=tt_content

headerField=header

#dataField=bodytext

ctypeField=ctype

ctype=list

listTypeField=list_type

list_type=flvplayer_pi1

flex=1

flex.field=pi_flexform

flex.uploadFileSheet=sDEF

flex.uploadFileField=file

flex.data.sDef.lDef.autostart.vDEF=1

#fileField=tx_metaftpd_ftpfile

#systemTransform=unzip -p '%s' content.xml | /usr/local/bin/o3tohtml

}

plugin.tx_metaftpd.pdf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=/usr/bin/pdftotext '%s' -enc Latin1 -layout -

}

plugin.tx_metaftpd.mp3.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=id3v2 -l  '%s'

}

plugin.tx_metaftpd.vcf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=cat '%s'

}

plugin.tx_metaftpd.txt.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=cat '%s'

}

plugin.tx_metaftpd.text.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=text

sep=<br>

#fileField=tx_metaftpd_ftpfile

systemTransform=cat '%s'

}

plugin.tx_metaftpd.xml.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=list

listTypeField=list_type

list_type=rlmp_officeimport_pi1

#sep=<br>

fileField=tx_rlmpofficeimport_office_file

#systemTransform=cat '%s'

}

plugin.tx_metaftpd.swf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.mov.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.mp3.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.wma.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.asf.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.swa.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.class.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.dcr.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.wav.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.avi.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.au.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.mpeg.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.mpg.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

plugin.tx_metaftpd.wmv.put {

table=tt_content

headerField=header

dataField=bodytext

ctypeField=ctype

ctype=multimedia

fileField=multimedia

}

Transformations to do :

Compressed formats

*.zip

*.arj

*.lzh

*.rar

*.cab

*.arc

*.gz

*.tar

*.jar

*.tgz

*.lha

*.zoo

*.uue

*.iso

*.bz2

Multimedia

*.wma

*.mp3

*.ogg

*.wav

*.mov

*.mpg

*.avi